/
dimono39
/
education-analytics
Обзор
Документация
Войти
/
dimono39
/
education-analytics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/live-server/test/proxy.js
26 строк
606 B
dimono39
добавил файлы
08 дек 2025, 15:17
08 дек 2025, 15:17
40ee2bb
Код
Авторство
О чём код?
var request = require('supertest'); var path = require('path'); var port = 40200; var server1 = require('..').start({ root: path.join(__dirname, "data"), port: port, open: false }); var server2 = require('..').start({ root: path.join(__dirname, "data"), port: 0, open: false, proxy: [ ["/server1", "http://localhost:" + port] ] }); describe('proxy tests', function() { it('should respond with proxied content', function(done) { request(server2) .get('/server1/index.html') .expect('Content-Type', 'text/html; charset=UTF-8') .expect(/Hello world/i) .expect(200, done); }); });