forked from akrylysov/lambda-phantom-scraper
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda.js
More file actions
Latest commit
15 lines (14 loc) · 349 Bytes
/
Copy pathlambda.js
File metadata and controls
15 lines (14 loc) · 349 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
varscrapper=require('./scraper');
exports.handler=function(event,context,callback){
if(event.url){
scrapper.scrape(event.url,function(err,result){
if(err){
returncallback(null,{error: result});
}
callback(null,{result: result});
})
}
else{
callback(null,{error: 'bad query'});
}
};