mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-29 21:46:43 -06:00
22 lines
372 B
TypeScript
22 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;
|