import * as path from 'path';
import * as express from 'express';
import * as expressWs from 'express-ws';
const SERVER_PORT = 8090;
let appBase = express();
let wsInstance = expressWs(appBase);
let { app } = wsInstance; // let app = wsInstance.app;
// Http Routes
app.use('/assets', express.static(path.join(process.cwd(), 'assets')));
// Ws Routes
app.ws('/echotwice', (ws, req) => {
ws.on('message', msg => {
ws.send(msg + msg);
});
});