Skip to content

Instantly share code, notes, and snippets.

@deanshub
Created June 6, 2019 10:19
Show Gist options
  • Save deanshub/344b3bbe2ceeb3d731793cb39e4ad885 to your computer and use it in GitHub Desktop.
Save deanshub/344b3bbe2ceeb3d731793cb39e4ad885 to your computer and use it in GitHub Desktop.
import {setStrimModules, setWs} from 'strim-js'
import http from 'http'
import express from 'express'
import bodyParser from 'body-parser'
import path from 'path'
const app = express()
const STATIC_FILES_DIRECTORY = path.join(__dirname, '../client/static')
app.use(bodyParser.json())
app.use(express.static(STATIC_FILES_DIRECTORY))
const httpServer = http.createServer(app)
setWs(httpServer)
setStrimModules(app, {modulesPath: './myModules'})
httpServer.listen(3000, () => {
console.log('Server listening on port 3000!')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment