Coder Social home page Coder Social logo

addressbook-deno's Introduction

Example HTTP API Server running on Deno.

This is a port for Deno of my addressbook Node.js demo.

Install and Run

  1. Fork and clone this repository.
  2. Set up environment.
$ cp env-example .env
$ source .env
  1. Install/Update dependencies.
$ deno cache --reload src/deps.ts
  1. Start a postgres database.
$ docker run -it -d -p 5432:5432 postgres
  1. Create the tables.
$ deno run --allow-net --allow-env src/migrate.js
  1. Run the application:
$ deno run --allow-net --allow-env src/app.js

Testing

The project ships with some sample tests that take advantage of Deno’s built-in test runner.

Run the unit tests:

$ docker run -it -d -p 5432:5432 postgres
$ deno run --allow-net --allow-env src/migrate.js
$ deno test --allow-net --allow-env src/test/database.test.js

Run the integration tests:

$ docker run -it -d -p 5432:5432 postgres
$ deno run --allow-net --allow-env src/migrate.js
$ deno run --allow-net --allow-env src/app.js &
$ deno test --allow-net --allow-env src/test/app.test.js

Docker

The whole application can be packaged in a Docker image for easier deployment.

$ docker build -t addressbook-deno .

License

Copyright (c) 2020 Rendered Text

Distributed under the MIT License. See the file LICENSE.md.

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.