UNPKG

generator-begcode

Version:

Spring Boot + Angular/React/Vue in one handy generator

16 lines (15 loc) 343 B
import https from 'https'; const httpsGet = (url, onSuccess, onFail) => { https .get(url, res => { let body = ''; res.on('data', chunk => { body += chunk; }); res.on('end', () => { onSuccess(body); }); }) .on('error', onFail); }; export default httpsGet;