This Node.js application allows you to create and retrieve timestamped text files.
The project uses Express for handling HTTP requests and the Node.js fs module for file system operations.
- Create a Timestamped File: Create a text file with the current timestamp as its name and content.
- Read Timestamped Files: Retrieve a list of all
.txtfiles in theTimefilefolder.
Endpoint: /create-file Method: GET Description: This endpoint creates a new text file in the timefile folder. The file name and its content will be the current timestamp.
Api Example: http://localhost:8000/create-file
Response will be like this: { "message": "File created", "fileName": "1692184800000.txt" }
Endpoint: /read-files Method: GET Description: This endpoint returns a list of all .txt files in the timefile folder.
Api Example: http://localhost:8000/read-file
Response will be like this: { "files": [ "1692184800000.txt", "1692184812345.txt" ] }