Last active
September 1, 2017 06:52
-
-
Save whs/d42e563ff5bf4d173d8b0a3b71ce6241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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