Commit
·
0238f04
1
Parent(s):
3726cd2
Update server.ts
Browse files
server.ts
CHANGED
|
@@ -4,12 +4,8 @@ const app = new Koa();
|
|
| 4 |
|
| 5 |
app.use((ctx) => {
|
| 6 |
console.log(ctx.request.url, ctx.request.method);
|
| 7 |
-
ctx.
|
| 8 |
-
|
| 9 |
-
query: ctx.request.query,
|
| 10 |
-
headers: Object.fromEntries(Object.entries(ctx.request.headers)),
|
| 11 |
-
env: process.env
|
| 12 |
-
};
|
| 13 |
});
|
| 14 |
|
| 15 |
app.listen(7860);
|
|
|
|
| 4 |
|
| 5 |
app.use((ctx) => {
|
| 6 |
console.log(ctx.request.url, ctx.request.method);
|
| 7 |
+
ctx.status = 307;
|
| 8 |
+
ctx.headers.location = `http://localhost:24242${ctx.request.path}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
});
|
| 10 |
|
| 11 |
app.listen(7860);
|