@keystonejs/app-static
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/keystonejs__app-static package

5.2.3 • Public • Published

Static file app

This is the last active development release of this package as Keystone 5 is now in a 6 to 12 month active maintenance phase. For more information please read our Keystone 5 and beyond post.

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('@keystonejs/keystone');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');
const { StaticApp } = require('@keystonejs/app-static');

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

Config

Option Type Required Description
path string true The path to serve files from.
src string true The path to the folder containing static files.
fallback string false The path to the file to serve if none is found. This path is resolved relative to the src path.

Readme

Keywords

none

Package Sidebar

Install

npm i @keystonejs/app-static

Weekly Downloads

412

Version

5.2.3

License

MIT

Unpacked Size

9.15 kB

Total Files

4

Last publish

Collaborators

  • emmatown
  • jedwatson
  • molomby
  • bladey