This is a simple nodejs REST API application.
You have two key task
- Find and fix any bugs in the code
- Add an API endpoint which takes JSON data and stores it in the file system
- Refactor functions in
./src/controllers.js
to not require a callback argument but instead return data to the caller. e.g
function sum(a, b, callback) {
callback(a + b);
}
sum(1, 1, result => {
console.log(result);
});
functions sum(a, b) {
return a + b;
}
const result = sum(2, 3);
console.log(result);
- Implement node cluster and ensure the app still runs as expected
To run the REST API, in the root folder run node .
or node index.js