https://github.com/seamapi/node-traefik
An NPM module for interfacing traefik. Easily reverse proxies and load balancers.
https://github.com/seamapi/node-traefik
Last synced: 3 months ago
JSON representation
An NPM module for interfacing traefik. Easily reverse proxies and load balancers.
- Host: GitHub
- URL: https://github.com/seamapi/node-traefik
- Owner: seamapi
- License: mit
- Created: 2021-07-06T21:35:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-19T01:51:59.000Z (over 1 year ago)
- Last Synced: 2025-10-01T15:56:17.669Z (7 months ago)
- Language: JavaScript
- Size: 231 KB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Node Traefik (traefik)
> Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy
Use [traefik](https://github.com/traefik/traefik) as an npm module for tighter integration with node apps.
## Usage
`npm install traefik`
```javascript
const traefik = require("traefik")
// Path to YAML/TOML
let service = await traefik.start("/path/to/traefik.yml")
// Static Config Only
service = await traefik.start({
defaultEntryPoints: ["http"],
entryPoints: {
http: {
address: ":3001",
},
},
"log.level": "DEBUG",
})
// Long Form
service = await traefik.start({
log: true,
staticConfig: {
defaultEntryPoints: ["http"],
entryPoints: {
http: {
address: ":3001",
},
},
// dot notation is also OK!
"log.level": "DEBUG",
},
dynamicConfig: {
http: {
routers: {
someRouter: {
service: "someService",
rule: "PathPrefix(`/`)",
},
},
services: {
someService: {
"loadBalancer.servers": [{ url: "http://localhost:3000" }],
},
},
},
},
})
await service.stop()
```
## Options
See the traefik [static configuration](https://doc.traefik.io/traefik/reference/static-configuration/file/) and [dynamic configuration](https://doc.traefik.io/traefik/reference/dynamic-configuration/file/) reference pages.