https://github.com/codewithveek/note-api
Note API built with NodeJS, Express and HarperDB.
https://github.com/codewithveek/note-api
Last synced: 16 days ago
JSON representation
Note API built with NodeJS, Express and HarperDB.
- Host: GitHub
- URL: https://github.com/codewithveek/note-api
- Owner: codewithveek
- License: mit
- Created: 2022-04-27T07:29:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-11T10:02:13.000Z (over 3 years ago)
- Last Synced: 2026-02-04T14:37:17.901Z (4 months ago)
- Language: JavaScript
- Homepage: note-api-chi.vercel.app
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# note-api
Note API built with NodeJS, Express and HarperDB.
You can find the article for this API [here](https://viblog.hashnode.dev/build-a-note-keeping-api-with-nodejs-express-and-harperdb).
## How to use.
Clone the repo
```
git clone https://github.com/Lucky-victory/note-api
```
Move into the directory
```
cd note-api
```
Copy the `.env.example` file to the `.env` file
```
cp .env.example .env
```
Fill out the following placeholders with correct details.
> if you don't have a HarperDB account, you can [sign up](https://harperdb.io?utm_source=luckyvictory) for a free account.
- `DB_HOST`: your HarperDB instance URL, e.g https://xxxxxxxxx.harperdbcloud.com
- `DB_USER`: your HarperDB instance username.
- `DB_PASS`: your HarperDB instance password.
Now, Run the following commands.
```
npm install
npm run db:init
npm run start
```
## Routes for the API
> except for the **account** route, every other route requires an apikey to be passed as a query parameter.
- **/account**
- `/sign-up [method=post]`: to register a new user.
- `/sign-in [method=post]` : to log in a user.
- **/notes**`[method=get]`: fetch a user's notes.
- `/new [method=post]`: add a new note.
- `/edit/:id [method=put]`: edit a note by its ID.
- `/to-trash:id [method=put]`: move a note to trash.
- `/out-of-trash:id [method=put]`: remove a note from the trash.
- **/tokens**
- `/new [method=post]`: generate a new apikey.
- `/revoke/:apikeyToRevoke [method=put]`: revoke an apikey.
- `/drop/:apikeyToDrop [method=delete]`: discard an apikey.
- **/trash** `[method=get]`: fetch notes in trash.
- `/trash/:noteID [method=delete]`: permanently discard a note.
## Example screenshots:
### acount route


### tokens route



### notes route




