Markdown 格式

1.代码格式

点击️链接

2.代码格式

1
2
3
4
5
6
7
8
9
10
11
import { Controller, Get } from '@midwayjs/core';

@Controller('/')
export class WeatherController {
// 这里是装饰器,定义一个路由
@Get('/weather')
async getWeatherInfo(): Promise<string> {
// 这里是 http 的返回,可以直接返回字符串,数字,JSON,Buffer 等
return 'Hello Weather!';
}
}