From a805d2476ae571d6ecb2c0c86771b5e8fb01afe3 Mon Sep 17 00:00:00 2001 From: cudr Date: Mon, 28 Oct 2019 19:56:12 +0300 Subject: [PATCH] fix: to deploy --- packages/example/server.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/example/server.js b/packages/example/server.js index f579cff..208f164 100644 --- a/packages/example/server.js +++ b/packages/example/server.js @@ -2,12 +2,12 @@ const Connection = require('@slate-collaborative/backend') const defaultValue = require('./src/defaultValue') const express = require('express') -const app = express() - -const server = require('http').createServer(app) - const PORT = process.env.PORT || 9000 +const server = express() + .use(express.static('build')) + .listen(PORT, () => console.log(`Listening on ${PORT}`)) + const config = { entry: server, // or specify port to start io server defaultValue, @@ -26,7 +26,3 @@ const config = { } const connection = new Connection(config) - -app.use(express.static('build')) - -server.listen(PORT)