Simple Deno Restful API using MySQL

Quick Start

Requirements

Deno >= 1.0.3

Install Denon

$ deno install --allow-read --allow-run --allow-write -f --unstable https://deno.land/x/denon/denon.ts

Install Velociraptor

$ deno install --allow-read --allow-write --allow-env --allow-run -n vr https://deno.land/x/velociraptor/cli.ts

Run Database

$ vr db:create
$ vr db:migrate

Run Server with Denon

$ vr server:dev

Run Server

$ vr server:run

Run with VSCode Debugger

Ctrl+Shift+D > Select Deno > Happy Debugging!

Usage

Configuration

modify config.ts file to change the default configuration

SERVER: 127.0.0.1:6790
DB: 127.0.0.1:3306 -u root -p toor

Endpoints

// author
GET      /api/authors            # get authors list
GET      /api/authors/:id        # get author data by id
POST     /api/authors            # create new author
PUT      /api/authors/:id        # update author data by id
DELETE   /api/authors/:id        # delete author data by id

// publisher
GET      /api/publishers         # get publishers list
GET      /api/publishers/:id     # get publisher data by id
POST     /api/publishers         # create new publisher
PUT      /api/publishers/:id     # update publisher data by id
DELETE   /api/publishers/:id     # delete publisher data by id

App Info

Authors

Hirzi Nurfakhrian

Version

1.0.0