Skip to content

Lucky-victory/note-api

Repository files navigation

note-api

Note API built with NodeJS, Express and HarperDB.

You can find the article for this API here.

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 for a free account.

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

Screenshot 2022-05-06 190623.png

Screenshot 2022-05-06 190814.png

tokens route

Screenshot 2022-05-07 090212.png

Screenshot 2022-05-07 090406.png

Screenshot 2022-05-07 090832.png

notes route

Screenshot 2022-05-06 191149.png Screenshot 2022-05-06 191408.png Screenshot 2022-05-06 235000.png Screenshot 2022-05-07 085836.png Screenshot 2022-05-07 085952.png

About

Note API built with NodeJS, Express and HarperDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published