Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.
Following example will read file content of data.json
file and convert it into object. __dirname
is root folder of your project.
Final example with created server and routing