0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00
verdaccio/test/functional/lib/simple_server.js

27 lines
519 B
JavaScript
Raw Normal View History

2017-11-27 01:15:09 -05:00
// @flow
import express from 'express';
import bodyParser from 'body-parser';
export default class ExpressServer {
2017-12-03 16:23:06 -05:00
app: any;
server: any;
2017-11-27 01:15:09 -05:00
2017-12-03 16:23:06 -05:00
constructor() {
this.app = express();
this.server;
}
2017-12-03 16:23:06 -05:00
start(port: number): Promise<any> {
return new Promise((resolve) => {
2017-12-03 16:23:06 -05:00
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({
extended: true
}));
2017-11-27 01:15:09 -05:00
2017-12-03 16:23:06 -05:00
this.server = this.app.listen(port, function starExpressServer() {
resolve();
});
});
}
2017-11-27 01:15:09 -05:00
}