I'm responding to myself since noticed a related issue on this thread.

After setting myapp as default app in routes.py whenever I try to redirect 
doing;

  
redirect(URL('newcontroller','index'))

server responds with 

invalid function (default/newcontroller)

Any hints on this?.

also (maybe a non-related issue), when using vue-router and refreshing page 
it would break the app, since most of the times the route doesn't exist as 
controllers in the server.

Marco.

On Tuesday, June 26, 2018 at 4:29:49 PM UTC-3, marco mansilla wrote:
>
> Thank you Anthony, this fixed the issue on development, and on production 
> should exist non.
>
> Adding web2cli as default app solved the problem.
>
> Oh, and just noticed I didn't send the link of the app [0] in the first 
> email. My bad.
>
> [0]  https://github.com/marcomansilla/web2cli
>
> Marco.
>
> On Tuesday, June 26, 2018 at 12:59:19 AM UTC-3, Anthony wrote:
>>
>> 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 <snide...@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+un...@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