1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-27 13:08:19 +09:00
cherrypick/src/server/proxy/index.ts
2019-09-27 05:50:34 +09:00

23 lines
372 B
TypeScript

/**
* Media Proxy
*/
import * as Koa from 'koa';
import * as cors from '@koa/cors';
import * as Router from '@koa/router';
import { proxyMedia } from './proxy-media';
// Init app
const app = new Koa();
app.use(cors());
// Init router
const router = new Router();
router.get('/:url*', proxyMedia);
// Register router
app.use(router.routes());
module.exports = app;