Skip to content

HalfAnElephant/web-note

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimalist Web Notepad (Bun)

A minimalist web notepad powered by Bun. An open-source clone of the now-defunct notepad.cc: "a piece of paper in the cloud".

Features

  • Create notes via URL: http://localhost:3000/any-note-name
  • Auto-save every second when content changes
  • Dark mode support (system preference)
  • CLI friendly (curl/wget support)
  • Print optimized
  • No database required (file-based storage)

Installation

# Install dependencies
bun install

# Start the server
bun run src/server.ts

The server will run on http://localhost:3000 by default. You can change the port using the PORT environment variable:

PORT=8080 bun run src/server.ts

Usage (CLI)

Using the command-line interface you can both save and retrieve notes:

Retrieve a note's content

curl http://localhost:3000/test-note > test.txt

Save text to a note

curl http://localhost:3000/test -d 'hello,
welcome to my pad!'

Save file content to a note

cat /etc/hosts | curl http://localhost:3000/hosts --data-binary @-

Project Structure

├── src/
│   ├── server.ts          # Main entry point
│   ├── router.ts          # Route handling
│   ├── handlers/
│   │   └── note.ts        # Note CRUD operations
│   └── utils/
│       ├── validation.ts  # Name validation & random generation
│       ├── storage.ts     # File operations
│       └── html.ts        # HTML templates & escaping
├── public/                # Static assets (favicons)
├── data/                  # Note storage (gitignored)
└── package.json

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors