⚠️ Reno has been sunset, and will thus no longer receive updates. The final version is v2.0.105, which supports Deno 1.34.3 and std 0.192.0.It is recommended that you use an alternative routing library or HTTP framework, such as Oak or Opine.
Thank you to anyone who supported the project during its lifetime.
Reno: 2019-2023
An example Reno microservice for creating and fetching blog posts from a PostgreSQL database.
This repo includes a Docker Compose configuration and a dedicated Dockerfile for local development, which together will:
- run a Postgres container, boostrapped with the provided SQL initialisation and seed scripts
- create a local network that's shared by both the database and microservice containers
- start the microservice via Denon, automatically restarting whenever the source code changes
If you haven't already, install Docker and Docker Compose, after which it's simply a case of running:
$ mv .env.sample .env
$ docker-compose up
The service will be available on port 8000, against which any of the requests under Operations can be made.
$ curl http://localhost:8000/posts
You can install the Deno dependencies and their accompanying TypeScript definitions onto your host machine by running deno cache deps.ts
; this isn't a prerequisite to running the service, but will allow your TS-enabled editor to discover said definitions, vastly improving the local development experience.
This project has extensive unit test coverage. The test suite can be invoked with deno test service
.
Retrieves metadata for all of the posts in the database.
Retrieves the metadata and content of the post with the given UUID.
Adds a new post to the database.
{
"title": "My new post",
"contents": "Here's the content body of my post",
"authorId": "<Author UUID>",
"tagIds": ["<Tag UUID>", ..."<Tag UUID>"]
}
Replaces the contents
property of the post with the given UUID.
{
"contents": "Here's the updated content body of my post"
}