5.1.2 • Published 4 years ago

@koikorn/app-static v5.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Static file app

View changelog

A KeystoneJS app to serve static files such as images, CSS and JavaScript with support for client side routing.

Usage

const { Keystone } = require('@koikorn/keystone');
const { GraphQLApp } = require('@koikorn/app-graphql');
const { AdminUIApp } = require('@koikorn/app-admin-ui');
const { StaticApp } = require('@koikorn/app-static');

module.exports = {
  keystone: new Keystone(),
  apps: [
    new GraphQLApp(),
    new AdminUIApp(),
    new StaticApp({
      path: '/',
      src: 'public',
      fallback: 'index.html',
    }),
  ],
};

Config

OptionTypeRequiredDescription
pathstringtrueThe path to serve files from.
srcstringtrueThe path to the folder containing static files.
fallbackstringfalseThe path to the file to serve if none is found. This path is resolved relative to the src path.