mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-09 18:50:39 +00:00
time based fix
This commit is contained in:
20
proxy.mjs
20
proxy.mjs
@@ -1,11 +1,19 @@
|
||||
import http from 'http'
|
||||
import httpProxy from 'http-proxy'
|
||||
|
||||
const proxy = httpProxy.createProxyServer({})
|
||||
function start() {
|
||||
try {
|
||||
const proxy = httpProxy.createProxyServer({})
|
||||
const 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)
|
||||
|
||||
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.on('error', () => start())
|
||||
} catch (e) {
|
||||
start()
|
||||
}
|
||||
}
|
||||
|
||||
server.listen(1234)
|
||||
start()
|
||||
|
Reference in New Issue
Block a user