summaryrefslogtreecommitdiff
path: root/src/server/proxy/index.ts
blob: 8d33af85dae269922ba973a33c1762a5b1dd8452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * 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;