You could also use routes.py to remove the app name in development.

Anthony

On Monday, June 25, 2018 at 8:27:29 PM UTC-4, marco mansilla wrote:
>
> Thanks Dave,  I'll try ASAP. 
>
> El lun., 25 de jun. de 2018 21:25, Dave S <snidely....@gmail.com> 
> escribió:
>
>>
>>
>> On Monday, June 25, 2018 at 4:51:31 PM UTC-7, marco mansilla wrote:
>>>
>>> Hi everyone, I have written this small simple test [0], which uses 
>>> vue-cli and inside web2py (yes, another test). It works pretty simple.
>>>
>>> 1- generate a devel project (name can be anything) the web2py app with 
>>> vue-cli
>>> 2- replace /views/layout.html with /deve/index.html
>>> 3- the boundle.js from devel project it redirected to be generated in 
>>> static/js/ by editing webpack.config.js inside devel project
>>>
>>> so far, so good it works.
>>>
>>> The issue I found, is since Vue works on the client side I can't use 
>>> URL(), so when I need to write a links has the app name in it 
>>> http://localhost:8000/myapp/foo/bar, on development it works, but in 
>>> production using routes.py urls change to http://mydomain.com/foo/bar, 
>>> so, the urls inside the files do not work.
>>>
>>> In the example app I have a simple table on a minimal api, as you can 
>>> see in web2cli/devel/src/components/People.vue the axios call has the app 
>>> name in it when moving to production it becomes an issue. Since web2py does 
>>> all the work on the server I know it is not possible to use URL() and any 
>>> native helpers from the client, does anyone has experienced similar issues?
>>>
>>> Marco.
>>>
>>
>> Parse window.location.href or window.location.pathname? 
>>
>> <URL:www.w3schools.com/js/js_window_location.asp>
>>
>> If you're doing AJAX, StackOverflow  Question 1034621 mentions
>> ${pageContext.request.contextPath}   // append "//controller/function" as 
>> needed
>>
>> /dps
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to