Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs API

This is a simple nodejs REST API application.

Task

You have two key task

  1. Find and fix any bugs in the code
  2. Add an API endpoint which takes JSON data and stores it in the file system

Bonus Task

  1. Refactor functions in ./src/controllers.js to not require a callback argument but instead return data to the caller. e.g

Given

function sum(a, b, callback) {
  callback(a + b);
}

sum(1, 1, result => {
  console.log(result);
});

Expeccted

functions sum(a, b) {
  return a + b;
}

const result = sum(2, 3);
console.log(result);
  1. Implement node cluster and ensure the app still runs as expected

Running the Application

To run the REST API, in the root folder run node . or node index.js

About

Sun King Demo

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages