javascript - Storing data in node.js -
i got assessment project company involves html,css , javascript. sent me zip file , i'm supposed implement app (which address book) using node.js sent.
the problem don't know node.js. i've been reading bunch of stuff online still couldn't figure out how store data. instructions said data managed server , can interacted using api:
api:
get - api/contacts/ params: none returns list of contacts - api/contacts/:id params: { id: int } returns contact given id or null if contact not exist post - api/contacts/ data: { firstname: string, lastname: string, email: string } returns saved contact put - api/contacts/ data: { id: int, contact: { firstname: string, lastname: string, email: string } } return updated contact delete - api/contacts/:id params: { id: int } returns true or false depending on if contact deleted
i don't know how approach problem. front-end internship position. thought using ajax or think may making more complicated has because that's backend stuff. there has easier way of doing maybe use function/method or something?
update
i spent monday night brushing on javascript (i'm senior @ university doesn't teach js self-taught) studied backbone.js same night. thought bit complicated decided not way because don't want company think know backbone.js.
i didn't know in beginning because didn't know node.js either had lot of reading that. thinking of several ways of approaching , needed guide couldn't find any.
anyway thank example. learn best seeing examples.
well, first need use express framework can easely setup routes api. data storage, use mongodb , mongoose, kind of abstraction mongodb helpful stuff out of box.
that's all.
Comments
Post a Comment