Last active
April 7, 2017 08:25
-
-
Save mbeloshitsky/3d92f9a98c6f95a55c5ce56e750c9e65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Прокси-сервер для отладки удаленных инсталляций. | |
* | |
* Алгоритм работы - точку подключения /events и каталог /xml перенаправляем | |
* к удаленному серверу, а весь фронтэнд используем наш. | |
*/ | |
const express = require('express') | |
, app = express() | |
, proxy = require('http-proxy-middleware')({target: process.env.REMOTE}); | |
app.use('/xml', proxy); | |
app.use('/events', proxy); | |
app.use('/', express.static('./dist')); | |
app.listen(8080, function() { | |
console.log('Proxifing remote ' + process.env.REMOTE); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment