Midway - 一个面向未来的云端一体 Node.js 框架
<a href="https://github.com/midwayjs/midway/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license" /></a>
<a href=""><img src="https://img.shields.io/github/tag/midwayjs/midway.svg" alt="GitHub tag"></a>
<a href="#"><img src="https://github.com/midwayjs/midway/actions/workflows/nodejs.yml/badge.svg?branch=3.x" alt="Build Status"></a>
<a href="https://codecov.io/gh/midwayjs/midway/branch/master"><img src="https://img.shields.io/codecov/c/github/midwayjs/midway/master.svg" alt="Test Coverage"></a>
<a href="https://lernajs.io/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg" alt="lerna"></a>
<a href="https://github.com/midwayjs/midway/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
<a href="https://gitpod.io/#https://github.com/midwayjs/midway"><img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
<a href="https://github.com/midwayjs/mwts"><img src="https://img.shields.io/badge/code%20style-midwayjs-brightgreen.svg" alt="Code Style: MidwayJS"></a>
<a href="https://opensource.alibaba.com/contribution_leaderboard/details?projectValue=midway"><img src="https://img.shields.io/badge/Midway-%E6%9F%A5%E7%9C%8B%E8%B4%A1%E7%8C%AE%E6%8E%92%E8%A1%8C%E6%A6%9C-orange" alt="Leaderboard"></a>
English | 简体中文
Midway 是一个适用于构建 Serverless 服务,传统应用、微服务,小程序后端的 Node.js 框架。
Midway 可以使用 Koa,Express 或 Egg.js 作为基础 Web 框架。它还提供了独立使用的基本解决方案,例如 Socket.io,GRPC,Dubbo.js 和 RabbitMQ 等。
此外,Midway 也适用于前端/全栈开发人员的 Node.js 无服务器框架。构建下一个十年的应用程序。可在 AWS,阿里云,腾讯云和传统 VM /容器上运行。与 React 和 Vue 轻松集成。 🌈
import { Controller, Get, Provide } from '@midwayjs/decorator';
@Provide()
@Controller('/')
export class HomeController {
@Get('/')
async home() {
return `Welcome to midwayjs!`;
}
}
后端代码 src/apis/lambda/index.ts
import {
Api,
Get,
Query,
useContext,
} from '@midwayjs/hooks';
export default Api(
Get(),
Query<{
page: string;
limit: string;
}>(),
async () => {
const ctx = useContext();
return {
page: ctx.query.page,
limit: ctx.query.limit,
};
}
);
前端调用 src/page/index.tsx
import getArticles from './api';
const response = await getArticles({
query: { page: '0', limit: '10' },
});
console.log(response); // { page: '0', limit: '10' }
手动调用
fetch('/api/articles?page=0&limit=10')
.then((res) => res.json())
.then((res) => console.log(res)); // { page: '0', limit: '10' }
$ npm -v
## 选择模版
$ npm init midway
## 进入项目路径
cd my_midway_app && npm run dev
1、Cool-Admin - 一个很酷的后台权限管理框架

群里会有热心的朋友,也会有新版本发布推送。

请告知我们可以为你做些什么,不过在此之前,请检查一下是否有 已经存在的Bug或者意见。
如果你是一个代码贡献者,请参考代码贡献规范。
你也想加 Logo ?可以点击 这里 添加。
我们的代码使用 MIT 协议,请放心使用。
$ claude mcp add midway \
-- python -m otcore.mcp_server <graph>