Merge pull request #174 from johnthad/issue-167

Use the dev.port value from config/index.js vs. hard coding.
This commit is contained in:
Sara Steiert 2017-12-15 23:30:29 +01:00 committed by GitHub
commit a3f0d8aac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,12 @@ const fs = require('fs');
const path = require('path');
const Rx = require('rxjs/Rx');
const http = require('http');
const config = require('../config');
const fetchResponse = () => {
return new Promise((res, rej) => {
try {
const req = http.request('http://localhost:8080/#/', response => res(response.statusCode));
const req = http.request(`http://localhost:${config.dev.port}/#/`, response => res(response.statusCode));
req.on('error', (err) => rej(err));
req.end();
} catch (err) {
@ -46,7 +47,7 @@ const convert = async () => {
args: ['--no-sandbox']
});
const page = await browser.newPage();
await page.goto('http://localhost:8080/#/resume/' + dir.name, {
await page.goto(`http://localhost:${config.dev.port}/#/resume/` + dir.name, {
waitUntil: 'networkidle2'
});
await page.pdf({