Reputation: 487
i am learning all the technologies necessary to build a Single Page Applications (SPA’s). As a summary, i want to implement my app as separate layers, where front-end only communicate with back-end using API web services (json through socket.io). Front-end will be basically Backbone.js (+ html5, css3, jquery), and back-end using node.js (+ mongodb, express, etc.). The decission of using node is because of socket.io.
My questions maybe sounds pretty basic, but i still don't get it.
on this configuration, is it necessary to use Express.js? as far as i know, the main features of Express.js are offering Web API and serving web pages through routing. But since i want to build up a entire front-end with Backbone.js as a SPA, and serving CRUD through Socket.io, is Express.js necessary on my project?
on this configuration, the node sever would just listens for socket.io crud commands, right? in here, there is no need to use Express.js as rest api server, right?
If i only want Web API and real time CRUD multicast operations ( like you can do with Socket.io), is it a must using Node.js as a back-end, or i could use another technology?
i hope someone could enlight me with some answers, and thank you very much in advance for your time and support.
FOR EDITORS: since months i am having some big issues with accepted answers. I always accept them, but stackoverflow always shows that i don't. I really would appreciate if some stackoverflow editor could help me with this issue.
Upvotes: 4
Views: 3897
Reputation: 123473
on this configuration, is it necessary to use Express.js?
No. The only requirement for socket.io is a listening http.Server
.
on this configuration, the node sever would just listens for socket.io crud commands, right?
Possibly. You still need to be able to serve up any (static) files necessary for the SPA to begin making WebSocket requests.
[...] is it a must using Node.js as a back-end, or i could use another technology?
Not necessarily. The socket.io library does require Node.js. But, if you just need the functionality of it, there are other options listed under "In other languages."
Upvotes: 3