diff options
Diffstat (limited to 'packages/kovan-faucets/src/ts/server.ts')
-rw-r--r-- | packages/kovan-faucets/src/ts/server.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/packages/kovan-faucets/src/ts/server.ts b/packages/kovan-faucets/src/ts/server.ts deleted file mode 100644 index 23642787d..000000000 --- a/packages/kovan-faucets/src/ts/server.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as bodyParser from 'body-parser'; -import * as express from 'express'; - -import { errorReporter } from './error_reporter'; -import { Handler } from './handler'; - -// Setup the errorReporter to catch uncaught exceptions and unhandled rejections -errorReporter.setup(); - -const app = express(); -app.use(bodyParser.json()); // for parsing application/json -app.use((req, res, next) => { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); - next(); -}); - -const handler = new Handler(); -app.get('/ping', (req: express.Request, res: express.Response) => { - res.status(200).send('pong'); -}); -app.get('/ether/:recipient', handler.dispenseEther.bind(handler)); -app.get('/zrx/:recipient', handler.dispenseZRX.bind(handler)); - -// Log to rollbar any errors unhandled by handlers -app.use(errorReporter.errorHandler()); -const port = process.env.PORT || 3000; -app.listen(port); |