YEPS express wrapper
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.editorconfig
.eslintrc
.gitignore
.istanbul.yml
.travis.yml
LICENSE
README.md
appveyor.yml
index.js
package.json

README.md

YEPS express wrapper

It helps run express middleware on YEPS

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-express-wrapper

How to use

const path = require('path');
const App = require('yeps');
const error = require('yeps-error');
const Router = require('yeps-router');
const server = require('yeps-server');

const wrapper = require('yeps-express-wrapper');

const app = new App();
const router = new Router();

// express middleware
const favicon = require('serve-favicon');

app.then(wrapper(favicon(path.join(__dirname, 'public', 'favicon.ico'))));

app.then(error());

router.get('/').then(async ctx => {
    ctx.res.statusCode = 200;
    ctx.res.end('test');
});

app.then(router.resolve());

server.createHttpServer(app);

YEPS documentation