You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 7 година
пре 7 година
пре 7 година
пре 7 година
пре 7 година
пре 7 година
12345678910111213141516171819202122232425
  1. var express = require('express');
  2. var app = express();
  3. app.use('/dist', express.static(__dirname + '/dist'));
  4. app.get('/', function(req, res) {
  5. res.sendFile(__dirname + '/index.html');
  6. });
  7. var _resolve;
  8. var readyPromise = new Promise(resolve => {
  9. _resolve = resolve
  10. });
  11. var server = app.listen(8080, function() {
  12. console.log('frontend listening on port 8080');
  13. _resolve();
  14. });
  15. module.exports = {
  16. ready: readyPromise,
  17. close: () => {
  18. server.close()
  19. }
  20. };