lakei
v1.1.10
Published
Lakei is a configurable web server. It uses Koa to serve a folder staticly.
Downloads
4
Readme
Lakei
Lakei is a configurable web server. It uses Koa to serve a folder staticly.
Example usage
npm i -g lakei
lakei -f dist -p 3000 -c lakei.config.json
This serves the dist folder on port 3000 and uses the "lakei.config.json" file as a configuration file.
Arguments
- "-p": Port (number)
- "-f": Folder (string)
- "-username": Username if auth is enabled (string)
- "-password": Password if auth is enabled (string)
- "-c": Path to lakei config (string)
- "-s": Silence logs ("true" | "false")
Configuration
Lakei supports JSON5
.lakei.config.json
{
"auth": {
"whitelistIps": ["127.0.0.1"]
},
"fallback": "index.html",
"headers": [
{
"filePattern": ["**/!(*.*)", "**/_payload.js"],
"headers": {
"Cache-Control": "public, max-age=60, must-revalidate",
"CDN-Cache-Control": "public, max-age=60, stale-if-error=86400"
}
},
{
"filePattern": ["!_nuxt/**.*", "**/_nuxt/**"],
"headers": {
"Cache-Control": "public, max-age=31536000, immutable",
"CDN-Cache-Control": "public, max-age=31536000, immutable, stale-if-error=86400"
}
}
]
}
If a file is not found, it will attempt to redirect the user to a "404.html" file in the given folder