Build APIs for powering the text editing site. Acceptance criteria:
POST
requests to /api/files
to create a file.GET
requests to /api/files
to get the an array containing all the files.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.