2 ms·
I love that style too actually - and always prefer it when I can. Sometimes, you just need parameters. But more and more I'm writing apps with no backend (Str
by matryer 13y ago
I love that style too actually - and always prefer it when I can. Sometimes, you just need parameters.
But more and more I'm writing apps with no backend (Stretchr makes it easy to do so) in just HTML5 and JavaScript... and serving pages like that tends to be more difficult.
I use a simple web server (like Thru http://github.com/stretchr/thru http://github.com/stretchr/thru) that doesn't do any routing or path parsing etc.
- NathanKP 13y agoNice. I'm a big fan of little to no backend as well. I've done a similar simple web server in Node.js which does nothing but check to see if a static file exists to serve the request. If so it serves that static file. If not then it serves the index.html page. The index.html page then has Backbone logic to parse the URL and serve a proper view based on what the URL is. It matches up nicely with the REST style URL's and you still don't need a heavy backend to do routing that way.