-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from jdub233/release/0.0.2
Release/0.0.2
- Loading branch information
Showing
7 changed files
with
381 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules | ||
.serverless | ||
config.yml | ||
config*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "bu-page-capture-s3", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Capture a page an associated assets and push it to object storage", | ||
"main": "index.js", | ||
"author": "[email protected]", | ||
|
@@ -10,7 +10,7 @@ | |
"log": "sls logs --function capture" | ||
}, | ||
"dependencies": { | ||
"del": "^4.1.1", | ||
"del": "^5.1.0", | ||
"s3-node-client": "^4.4.4", | ||
"url-parse": "^1.4.7", | ||
"website-scraper": "^4.0.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = class ValidatePlugin { | ||
apply(registerAction) { | ||
registerAction('error', async ({error}) => {console.error(error)}); | ||
registerAction('onResourceError', ({resource, error}) => console.log(`Resource ${resource.url} has error ${error}`)); | ||
registerAction('afterResponse', async ({response}) => { | ||
if (response.statusCode !== 200) { | ||
// Don't capture bad assets. Also cancels the upload phase if the root page has a bad status code. | ||
console.log( `A bad status code ${response.statusCode} was encountered, cancelling asset capture` ); | ||
return null; | ||
} else { | ||
return { | ||
body: response.body, | ||
metadata: { | ||
headers: response.headers, | ||
} | ||
}; | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.