lakei

1.1.10 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i lakei

Weekly Downloads

11

Version

1.1.10

License

MIT

Unpacked Size

18 kB

Total Files

25

Last publish

Collaborators

  • simondtd