I create a simple sails.js project and implement the front end with the foundation.
Ideally, I want one route per index page, on which my base application is submitted.
'/*': { view: 'home/index' }
This is great, so any URL is now sent to the home page. In addition, all routes to any assets (.js, .css, .html, .jpg) no longer work.
I see this comment in config.routes.js :
// NOTE: // You'll still want to allow requests through to the static assets, // so we need to set up this route to ignore URLs that have a trailing ".": // (eg your javascript, CSS, and image files) 'get /*(^.*)': 'UserController.profile'
But that makes no sense to me. How to ignore routes with file extensions.
I also prefix all my CRUD urls with api ', localhost:1337/api/controller/ , so a regular route will also be required to prevent forwarding. I cannot find any information on how to do this anywhere.
I have to miss something fundamental here.
Thanks!
source share