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:
commit
a3f0d8aac0
@ -3,11 +3,12 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const Rx = require('rxjs/Rx');
|
const Rx = require('rxjs/Rx');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
const config = require('../config');
|
||||||
|
|
||||||
const fetchResponse = () => {
|
const fetchResponse = () => {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
try {
|
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.on('error', (err) => rej(err));
|
||||||
req.end();
|
req.end();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -46,7 +47,7 @@ const convert = async () => {
|
|||||||
args: ['--no-sandbox']
|
args: ['--no-sandbox']
|
||||||
});
|
});
|
||||||
const page = await browser.newPage();
|
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'
|
waitUntil: 'networkidle2'
|
||||||
});
|
});
|
||||||
await page.pdf({
|
await page.pdf({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user