Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- request.get({ url: blogUrl }, function (err, res, blogFeedPage) {
- if (err) return next({ status: 502, message: 'error while trying to contact the blog feed server' })
- var child = childProcess.fork(__dirname + '/child.js')
- child.on('message', function (blogFeeds) {
- child.kill()
- if (!blogFeeds || blogFeeds && blogFeeds.error) {
- return next({ status: 503, message: 'Error while trying to parse the blog feed' })
- }
- clientRes.sendSuccess(200, 'success', blogFeeds)
- res.status(200).send({ status: 'success', data: blogFeeds })
- })
- child.on('exit', function (code, signal) {
- child.kill()
- })
- child.on('error', function (error) {
- child.kill()
- })
- child.send({ html: blogFeedPage })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement