Lightweight tiny zero-configuration SPA HTTP server. Serves SPA bundle on port 80 which makes it play well with traefik
- Zero-configuration, add it to your pipeline without managing additional configs
- Written in Go, which makes it fast and tiny
- Supports Brotly compression on original files, you don’t need to archivate files by yourself, it does it for you
- Open-Source commertial friendly MIT license
- Plays well with all popular SPA frameworks and libraries: Vue, React, Angular and all bundlers: Webpack/Vite.
- Optimal statics caching out of the box: no-cache on index.html file to auto-update caches and infinite max-age for all other resources which have hash-URLs in all SPA frameworks.
- Created and maintained by Devforth 💪🏼
Dockerfile in yoru SPA directory (near
FROM node:16-alpine as builder WORKDIR /code/ ADD package-lock.json . ADD package.json . RUN npm ci ADD . . RUN npm run build FROM devforth/spa-to-http:latest COPY --from=builder /code/dist/ .
||Address to use||0.0.0.0|
||Port to use||8080|
||When enabled it will create .gz files using gzip compression for files which size exceedes threshold and serve it instead of original one if client accepts gzip encoding. If brotli also enabled it will try to serve brotli first||
||When enabled it will create .br files using brotli compression for files which size exceedes threshold and serve it instead of original one if client accepts brotli encoding. If gzip also enabled it will try to serve brotli first||
||Threshold in bytes for gzip and brotli compressions||1024|
||Directory to serve||
||Whether to show directory listing. SPA mode and directory listing cannot be enabled at the same time||
||Set cache time (in seconds) for cache-control max-age header||604800|
||Where to enable SPA mode. In SPA mode if file for requested path does not exists server returns index.html from root of serving directory. SPA mode and directory listing cannot be enabled at the same time||