Skip to content

Latest commit

 

History

History

api

Challenge - API

This API use Deno, Oak, PostgeSQL

Instalation

Requiriments

  • Deno 1.27.x

Run

  1. Create a .env file, copy of the env.example.
  2. Create a cache sources running:
$ deno cache deps.ts dev_deps.ts
  1. Initialize database with:
$ deno task init:db

To see all deno task options, run: deno task.

  1. Exceute task dev(dev to watch mode):
$ deno task dev
  1. Tests - execute:
$ deno task test

Routes

Table of Routes:

Method Path query body(json)
GET /api/status
GET /api/cpf ?like=string&sort=asc desc
GET /api/cnpj ?like=string&sort=asc desc
POST /api/cpf {cpf: string}
POST /api/cnpj {cnpj: string}
PUT /api/cpf/:id {cpf: string}
PUT /api/cnpj/:id {cnpj: string}
DELETE /api/cpf/:id
DELETE /api/cnpj/:id

Have fun!