Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

kasramp/deno-oak-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno-oak-rest

The goal of the project is to buld REST APIs with Deno and Oak library.

For the tutorials check the below links,

How to run

First of all make sure you have Deno installed.

Then start MySQL docker and run the db_initializer.sh script to create the users table,

$ cd docker && docker-compose up -d && ./db_initializer.sh

And finally run the following command,

$ deno run --allow-env --allow-read --allow-net index.js

Now, open the browser and hit localhost:8080.

Endpoints

  • GET / - displays welcome page
  • GET /v1/users - returns a list of users
  • GET /v1/users/:id - gets a user by id
  • POST /v1/users - creates a new user
  • PUT /v1/users/:id - update an existing user
  • DELETE /v1/users/:id - deletes a user by id