get

  1. const express = require('express')
  2. const app = express()
  3. app.get('/', (req, res) => {
  4. res.send('这是 GET')
  5. })

post

  1. const express = require('express')
  2. const app = express()
  3. app.post('/', (req, res) => {
  4. res.send('这是 POST')
  5. })