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.
21 lines
376 B
JavaScript
21 lines
376 B
JavaScript
#!/usr/bin/node
|
|
|
|
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);
|
|
console.log("Listening on port 8383");
|