-
-
Save MichalGniadek/88ec706481e0073c6be86ea102b5e726 to your computer and use it in GitHub Desktop.
This file contains 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
// @flow | |
import express from 'express'; | |
// eslint-disable-next-line prettier/prettier | |
/*:: import type { $Request, $Response } from 'express';*/ | |
import hazel from 'hazel-server'; | |
const hazelServer = hazel({ | |
// Cache refresh interval (in minutes) | |
interval: 15, | |
repository: process.env.HAZEL_REPOSITORY ?? 'comm', | |
account: process.env.HAZEL_ACCOUNT ?? 'CommE2E', | |
}); | |
const app = express(); | |
// eslint-disable-next-line prettier/prettier | |
app.all('*', (req/*:: : $Request*/, res /*:: :$Response*/) => { | |
hazelServer(req, res); | |
}); | |
app.listen(parseInt(process.env.HAZEL_PORT, 10) || 80); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment