标签:style async router bsp new span server fun code
const koa = require(‘koa‘), app = new koa(), Router = require(‘koa-router‘), router = new Router(), host = ‘127.0.0.1‘, port = 12899, jsonwebtoken = require(‘jsonwebtoken‘), jwt = require(‘koa-jwt‘); router.get(‘/‘, async function (ctx, next) { ctx.body = ‘hello world‘; }); app.use(router.routes()); app.listen(port,host, function () { console.log(`server is running in http://${host}:${port}`); });
const koa = require(‘koa‘),
app = new koa(),
Router = require(‘koa-router‘),
router = new Router(),
host = ‘127.0.0.1‘,
port = 12899,
jsonwebtoken = require(‘jsonwebtoken‘),
jwt = require(‘koa-jwt‘);
router.get(‘/‘, async function (ctx, next) {
ctx.body = ‘hello world‘;
});
app.use(router.routes());
app.listen(port,host, function () {
console.log(`server is running in http://${host}:${port}`);
});
标签:style async router bsp new span server fun code
原文地址:https://www.cnblogs.com/heidekeyi/p/11040635.html