Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1014 Bytes

File metadata and controls

45 lines (31 loc) · 1014 Bytes

📂 TimeStamp File Creator API using Node.js & Express

This project is a simple backend API built using Node.js and Express.js that creates a new file with the current timestamp as the filename and content. It uses the built-in fs module for file system access and date-fns for date formatting 📆.


🛠 Tech Stack

  • Node.js
  • Express.js
  • fs (file system Module)
  • date-fns
  • dotenv
  • CORS

📄 Example

If you hit /file at 17th June 2025, 10:30:45, a file will be created like:

TimeStamps/17-06-2025-10-30-45

And the content will be:

17-06-2025-10-30-45

📘 What I Practiced

  • Using Express.js to set up routes
  • Reading and writing file using fs
  • Formating timestamps using date-fns
  • Creating REST APIs
  • Using dotenv for environment configuration

📌 Notes

  • Ensure the TimeStamps folder exists before starting the server.
  • Make sure the port in .env is not already used by another process.