Skip to content

evheniy/yeps-index

Repository files navigation

YEPS index

YEPS Static index.html file serving

NPM

npm version Build Status Coverage Status Linux Build Windows Build

Dependency Status devDependency Status NSP Status

License GitHub stars GitHub forks GitHub issues Twitter

How to install

npm i -S yeps-index debug

How to use

const App = require('yeps');
    
const index = require('yeps-index');
    
const error = require('yeps-error');
const logger = require('yeps-logger');
const server = require('yeps-server');
    
const { resolve } = require('path');
    
const app = new App();
    
app.all([
  error(),
  logger(),
  index({
    root: resolve(__dirname, 'dist'),
  }),
]);
    
server.createHttpServer(app);

Or with options:

app.all([
  error(),
  logger(),
  serve({
    root: resolve(__dirname, 'dist'),
    index: 'index.html',
    url: '/',
  }),
]);

Url "/index.html" will be redirected to "/" with 301 http code.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published