Last active
March 2, 2019 20:06
-
-
Save JozefFlakus/dba51ef309ecdd3a5116beb0865d39ef 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
const httpsOptions: https.ServerOptions = { | |
key: fs.readFileSync('key.pem'), | |
cert: fs.readFileSync('cert.pem'), | |
}; | |
const listening$: HttpServerEffect = event$ => | |
event$.pipe( | |
matchEvent(ServerEvent.listening), | |
map(event => event.payload), | |
tap(({ port, host }) => console.log(`Running @ http://${host}:${port}/`)), | |
); | |
const server = createServer({ | |
port: 1337, | |
httpListener, | |
dependencies: [ | |
bindTo(token_1)(dependency_1), | |
bindTo(token_2)(dependency_2), | |
bindTo(token_3)(dependency_3), | |
], | |
event$: (...args) => merge( | |
listening$(...args), | |
// ... | |
), | |
options: { httpsOptions }, | |
}); | |
server.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment