Here you'll find a small node.js + express.js + backbone.js project that contains:
- Simple client that allows viewing, adding and editing models
- Degenerated node.js server that respects REST api on
/api/models
url
You need to implement the server side, good luck.
A change in the model should upload new content to s3 bucket bed.interview.rollout.io/<your_name_here>
Here is the story of the application:
- The client side CRUD the models and sends updates to the server via REST api
- On every change the server needs to put a json objects on AWS s3 bed.interview.rollout.io/<your_name_here>
- The json object should be a list of the models which satisfy
model.status=="production"
with a bit of change in the actual content, the only fields that should be available arename
andvalue
- ifmodel.type==="normal"
value
should benormal_value
- ifmodel.type==="weird"
value
should beweird_value
For Example, if available models are:
{ _id:"1", name:"name 1", status:"disable", type:"normal", normal_value:1, wierd_value:1},{ _id:"2", name:"name 2", status:"production", type:"wierd", normal_value:2, wierd_value:20.2}, { _id:"3", name:"name 3", status:"production", type:"normal", normal_value:3, wierd_value:30.3}
The resulting json should be (on s3 object)
[ {name: "name 2", value: 20.2}, {name:"name 3", value:3}]
Some notes:
- Caching should be disabled on the s3 object (html should not cache result)
- The server code is just a boilerplate code, feel free to remove it
- The server code can be written in any language you wish (that can run on linux)
- You need some DB on your side, we use mongodb
- You should forget about security in this question
- For any question please contact eyal, if you got this question you should know how to do it