Skip to content

Instantly share code, notes, and snippets.

@whs
Last active September 1, 2017 06:52
Show Gist options
  • Select an option

  • Save whs/d42e563ff5bf4d173d8b0a3b71ce6241 to your computer and use it in GitHub Desktop.

Select an option

Save whs/d42e563ff5bf4d173d8b0a3b71ce6241 to your computer and use it in GitHub Desktop.
export default function startServer(handler) {
AWSXRay.captureHTTPsGlobal(require('http'))
const app = express()
app.use(AWSXRay.express.openSegment('React'))
// load other middlewares
// load handlers
app.use(AWSXRay.express.closeSegment())
errorHandler(app) // error handling after end of segment
app.listen(config.s.port, () => {
console.log('SSR application port ' + config.s.port)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment