richardgirges / deno-todo-backend

Deno/Oak implementation of the Todo-Backend API spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deno-todo-backend

This is a simple example of a Deno + Oak API server implementation of the TODO Backend spec.

An accompanied blog post for this project can be found here.

Prerequisites

  • A running PostgreSQL server

Setup

Install Deno

https://deno.land/#installation

Run the Server

Run the src/server.ts script with environment variables and networking enabled:

deno run --allow-env --allow-net ./src/server.ts

If you need to run the server with non-default PostgreSQL parameters:

DB_HOST=localhost \
DB_PORT=5432 \
DB_USER=postgres \
DB_NAME=todo \
deno run --allow-env --allow-net ./src/server.ts

# inline:
DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_NAME=todo deno run --allow-env --allow-net ./src/server.ts

About

Deno/Oak implementation of the Todo-Backend API spec


Languages

Language:TypeScript 93.3%Language:Dockerfile 3.7%Language:PLpgSQL 3.0%