Some reddit pundits were confused about resourceserver and what the point of it might be. In this post I demonstrate the use of resourceserver as a backend for the todomvc SPA demo.
Using Resourceserver as a backend for an SPA / Backbone app
You’re on your own for this one. It is not hard and can be accomplished on *nix or windows.
git clone firstname.lastname@example.org:liammclennan/resourceserver.git
Todomvc is a reference app used to compare client-side web app libraries. It includes the same app (a todo app) built with a wide variety of libraries. We will use it as a client-side app to connect to resource server.
git clone email@example.com:tastejs/todomvc.git
This is optional. By default resourceserver will just store resources in memory. Edit resourceserver’s config.coffee:
module.exports = use_redis: true redis_config: host: 'localhost' port: 6379
Make sure the
redis_config settings match your redis installation.
In the directory where you cloned resourceserver:
We need to make a small modification to todomvc to enable server persistence.
- localStorage: new Backbone.LocalStorage('todos-backbone'), + url: 'http://localhost:3002/todos',