12345678910111213141516171819 |
- import Koa from 'koa';
- import { PORT, HOST } from './config/system.mjs';
- const app = new Koa();
- app.use((ctx) => {
-
- ctx.status = 200;
- ctx.message = 'OKK';
- ctx.type = 'application/json';
-
- ctx.body = { code: 0, data: [], msg: 'okk' };
- console.log('请求参数', ctx.query);
- });
- app.listen(PORT, HOST, () => {
- console.log(`服务已启动,URL地址为:${'http://' + HOST + ':' + PORT}`);
- });
|