yeps-index

0.0.4 • Public • Published

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.

YEPS documentation

Package Sidebar

Install

npm i yeps-index

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

6.8 kB

Total Files

4

Last publish

Collaborators

  • evheniy.bystrov