CORS on a Node.js server – send data

Tuesday, April 19, 2016

In last post I showed you to open your REST service for everyone to collect data out of it. I n this post I will show you how easy it is also to allow external origin to send data to your service. It is as simple as the last post with just one line. The scenario for this this requirement is fairly simple, you have a REST service which externalize CRUD operations for some data. e.g. a book collection where you can add new books, update, remove, etc. If we return to our middleware function, we need to add just one...
תגיות: , , , ,
2 תגובות

CORS on a Node.js server

Monday, April 18, 2016

In the last post I showed you how to start a new REST project with a Node.js server and Express framework. Doing just this will not do all the work needed if you plan to expose the service to other origins or let external users use it. You need to allow CORS just like I did in this post on a .Net REST service. The Express framework gives you a way to allow CORS very easily to your REST service using its middleware abilities. A middleware is just a function (or a set of functions which run one after the...
2 תגובות

Start using Node.js with Express framework and MongoDB

Sunday, April 17, 2016

In this post I`ll talk about Node.js, what it is and what is it good for. I will also talk about how to use the Express framework to leverage the use of Node.js, and I will demonstrate also the use of MongoDB to give you code samples for a fully working server application. Node.js So what is Node.js? Node.js is a runtime environment built on Google Chrome V8 JavaScript engine. It is used to basically run JavaScript files without the need for a browser as a middleman. That said, we can now do amazing things using the power of JavaScript on...
אין תגובות