Awesome Open Source
Awesome Open Source

Midway Logo

Midway - Node.js

GitHub license GitHub tag Build Status Test Coverage lerna PRs Welcome Gitpod Ready-to-Code Code Style: MidwayJS

English |

  • **** Web /Serverless/FaaS//
  • **** API "React Hooks "
  • **** Server Serverless/FaaS
  • **** Koa/Express/Egg.js
  • ****:
  • TypeScript

Midway Serverless Node.js

Midway KoaExpress Egg.js Web Socket.ioGRPCDubbo.js RabbitMQ

Midway / Node.js AWS VM / React Vue

Demo

Web

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 v6
$ npm init midway --type=web my_midway_app

#  npm v7
$ npm init midway -- --type=web my_midway_app

## 
cd my_midway_app && npm run dev

midway-examples

midway-examples

**1Cool-Admin - **

image

VSC Plugin

  • midway

Bug

image Logo

License

MIT

FOSSA Status

Alternatives To Midway
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (266,525
Reactjs (166,822
Vue (68,330
Amazon Web Services (38,650
Web (37,474
Cloud Computing (29,153
Azure (17,869
Serverless (10,005
Egg (2,213
Serverless Framework (1,283
Aliyun (1,137
Alibaba (952
Tencent (759
Dependency Injection Container (458
Midway (29
Mircoservices (16