This is a simple notes app built using Node.js, Express, and the fs module. The app allows users to
create and view notes stored as text files in the local filesystem.
- Create Notes: Add new notes with a title and content.
- List Notes: View all saved notes on the homepage.
- File Storage: Notes are stored as
.txtfiles in thefilesdirectory. - Validation: Ensures note titles are sanitized to avoid invalid file names.
-
Clone the repository:
git clone <repository-url> cd <project-directory>
-
Install dependencies:
npm install
-
Run the app:
node app.js
-
Open your browser and go to:
http://localhost:5000
.
├── app.js # Main server file
├── files/ # Directory where notes are stored
├── public/ # Static files (CSS, JS, etc.)
├── views/ # EJS templates
└── package.json # Project metadata and dependencies
- Homepage:
- Displays a list of all notes in the
files/directory.
- Displays a list of all notes in the
- Create Notes:
- Users can add a note with a title and content.
- The title is sanitized to remove invalid characters before saving.
- Node.js v16 or later
- npm