Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 697 Bytes

File metadata and controls

14 lines (11 loc) · 697 Bytes

NodeJS File System

Description

This exercise involves creating API endpoints to create a text file in a particular folder and to retrieve all the text files in that particular folder.

Functionalities Used

  1. Created an Express server
  2. Created two API endpoints using writeFileSync and readdirSync.
  3. writeFileSync to write data to a file.
  4. readdirSync to read the contents of the directory and it returns an array of names of files and directories inside the particular folder.

Deployed URL Endpoints

  1. To write a file - https://nodejsfilesystem-jq09.onrender.com/write-file
  2. To list the files in a directory - https://nodejsfilesystem-jq09.onrender.com/list-files