Coder Social home page Coder Social logo

araekiel / denote Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 37 KB

REST API with JWT authentication for a generic notes app built with Deno, and Oak.

License: MIT License

TypeScript 100.00%
deno oak typescript rest rest-api crud notes notes-app crud-application denon generic authentication jwt jsonwebtokens

denote's Introduction

Denote

REST API with JWT authentication for a generic notes app built with Deno (v1.4.0), Oak, and TypeScript.

MIT License

Instructions

Follow the standard procedure to clone the repository and then continue with the steps.

Denote uses denon as a nodemon alternative for deno. After installing run the following command to install denon.

$ deno install --allow-read --allow-run --allow-write --allow-net -f -q --unstable https://deno.land/x/[email protected]/denon.ts

It will use the config specified in denon.json.

Run Denote with the following command:

$ denon start

If denon doesn't work (or if you don't want to monitor file changes) use the following command:

$ deno run --allow-net --allow-read server.ts

Denote reads the port it is supposed to run on from the '.env' file. The default port is 108.

Important information

API Endpoints

GET     /token                  # => Get auth token
GET     /api/users              # => Get all the users
POST    /api/users              # => Add a user
GET     /api/users/:id          # => Get one particular user
GET     /api/users/:id/notes    # => Get one user's notes
DELETE  /api/users/:id          # => Delete a user
GET     /api/notes              # => Get all the notes
GET     /api/notes/:id          # => Get one particular note
POST    /api/notes              # => Add a note
PUT     /api/notes/:id          # => Update a note
DELETE  /api/notes/:id          # => Delete a note

Default user creds

username: admin
password: admin

Accessing the API

To get started send a request to /token with the default username and password in the body to get the auth token. That token is required to be sent with every request to any other endpoint as the 'Authorization' header.

Update checklist

Status Update
โœ… JWT Authentication
NoSQL Database

denote's People

Contributors

shashwatah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

afrknchld

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.