You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
320 B
JavaScript
18 lines
320 B
JavaScript
3 years ago
|
import Koa from "koa";
|
||
|
import Router from "@koa/router";
|
||
|
import axios from "axios";
|
||
|
|
||
|
const router = new Router();
|
||
|
|
||
|
router.get("/", async (ctx) => {
|
||
|
const url = ctx.query.url;
|
||
|
const response = await axios.get(url);
|
||
|
ctx.body = response.data;
|
||
|
});
|
||
|
|
||
|
const app = new Koa();
|
||
|
|
||
|
app.use(router.routes());
|
||
|
|
||
|
app.listen(8383);
|