mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
4245636576
The package published can be printed into the template Improve error handling Improve notification documentation
26 lines
519 B
JavaScript
26 lines
519 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) => {
|
|
this.app.use(bodyParser.json());
|
|
this.app.use(bodyParser.urlencoded({
|
|
extended: true
|
|
}));
|
|
|
|
this.server = this.app.listen(port, function starExpressServer() {
|
|
resolve();
|
|
});
|
|
});
|
|
}
|
|
}
|