websocket - How to implement ReST services with Sails.js? -


i quite new node. came across sails.js. think based on websocket, seems building real-time applications. know whether sails can used implement rest architecture uses websocket? , if yes, how?

yes can. sails js allows build restful api, no effort started. also, websockets (through socket.io) integrated default view , api.

to create restful app ground up, requires no js. try:

sails new testapp cd testapp sails generate model user sails generate controller user cd <main root> sails lift 

the crud (create, read, update, delete) actions created you. no code!

you can create user in browser doing following: http post (using tool postman) http://:1337/user/create

{ "firstname": "bob", "lastname": "jones" }

next, see new user: http http://:1337/user/

fyi - sails js uses default disk based database going

done.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -