Asset Creation

Demo Link

Build APIs for powering the text editing site. Acceptance criteria:

  1. Listen to incoming POST requests to /api/files to create a file.
  2. Listen to incoming GET requests to /api/files to get the an array containing all the files.
  3. Listen to incoming GET requests to /api/files/file-name to get the content of file-name.

Note: fs.readdir takes in an argument (the path of folder) and a function. The function will be called with 2 arguments (error, data) when computer finishes.

To prevent your server from getting filled up with junk files, your server must automatically delete files after a 5 minute mark for each file.