mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 16:26:28 +00:00
12 lines
315 B
JavaScript
12 lines
315 B
JavaScript
|
import httpProxy from 'http-proxy'
|
||
|
import http from 'http'
|
||
|
|
||
|
const proxy = httpProxy.createProxyServer({})
|
||
|
|
||
|
var server = http.createServer(function (req, res) {
|
||
|
const target = req.url.startsWith('/api/') ? 'http://localhost:5000' : 'http://localhost:3000'
|
||
|
proxy.web(req, res, { target })
|
||
|
})
|
||
|
|
||
|
server.listen(1234)
|