0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/functional/lib/simple_server.js
2018-01-07 07:59:36 +00:00

26 lines
527 B
JavaScript

// @flow
import express from 'express';
import bodyParser from 'body-parser';
export default class ExpressServer {
app: any;
server: any;
constructor() {
this.app = express();
this.server;
}
start(port: number): Promise<any> {
return new Promise((resolve, reject) => {
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({
extended: true
}));
this.server = this.app.listen(port, function starExpressServer() {
resolve();
});
});
}
}