const express = require('express')
const proxy = require('http-proxy-middleware')

const app = express()

app.use('/api', proxy({ target: 'https://www.baidu.com', changeOrigin: true }))
app.listen(9000)

// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar