node.js - Difference between a server with http.createServer and a server using express in node js -
what's difference between creating server using http module , creating server using express framework in node js? thanks.
ultimately, express uses node's http api behind scenes.
express framework
the express framework provides abstraction layer above vanilla http module make handling web traffic , apis little easier. there's tons of middleware available express (and express-like) frameworks complete common tasks such as: cors, xsrf, post parsing, cookies etc.
http api
the http api simple , used to setup , manage incoming/outgoing ,http connections. node of heavy lifting here provide things you'll commonly see throughout node web framework such as: request
/response
objects etc.
Comments
Post a Comment