Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/limone-eth/template-node-express
https://github.com/limone-eth/template-node-express
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/limone-eth/template-node-express
- Owner: limone-eth
- Created: 2023-11-28T22:17:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-28T22:17:18.000Z (about 1 year ago)
- Last Synced: 2024-12-26T14:14:56.443Z (14 days ago)
- Language: TypeScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `template-node-express`
A minimal production-ready node HTTP server with [`Express`](https://expressjs.com/) and Typescript.
✅ Typescript \
✅ Graceful shutdown \
✅ Tracing with OpenTelemetry \
✅ Trust proxy \
✅ Structured logging with [`pino`](https://github.com/pinojs/pino) \
✅ Rich request logging middleware including request id, trace id, context propagation, and more \
✅ Testing with [`jest`](https://github.com/jestjs/jest) and [`supertest`](https://github.com/ladjs/supertest) \
✅ [`helmet`](https://github.com/helmetjs/helmet) & [`compression`](https://github.com/expressjs/compression)[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/KwYYFA?referralCode=ToZEjF)
## Installation
```sh
git clone https://github.com/dillonstreator/template-node-expresscd template-node-express
yarn install
yarn dev
```## Configuration
See all example configuration via environment variables in [`.env-example`](./.env-example)
### Open Telemetry
Open Telemetry is disabled by default but can be enabled by setting the `OTEL_ENABLED` environment to `true`.
By default, the trace exporter is set to standard output. This can be overridden by setting `OTEL_EXPORTER_OTLP_ENDPOINT`.
Start the `jaegertracing/all-in-one` container with `docker-compose up` and set `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318` to collect logs in jaeger. Docker compose will expose jaeger at http://localhost:16686