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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -