Skip to content

Commit

Permalink
参数fullPage默认为true
Browse files Browse the repository at this point in the history
  • Loading branch information
arbing committed Jan 6, 2019
1 parent 0605f46 commit 631b732
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/src/server.js",
"restart": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"author": "so <[email protected]>",
"license": "ISC",
"dependencies": {
"boolean": "^0.2.0",
"boom": "^7.2.2",
"debug": "^4.1.0",
"koa": "^2.6.1",
Expand Down
2 changes: 2 additions & 0 deletions src/controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Screenshot = require('../lib/Screenshot')
const Boom = require('boom')
const devices = require('../lib/DeviceDescriptors')
const deviceNames = devices.map(device => device.name)
const boolean = require('boolean')

const instance = new Screenshot()
;(async () => {
Expand Down Expand Up @@ -62,6 +63,7 @@ function checkOption(option, ctx) {
let style = option.style
let script = option.script
screenshot.type = screenshot.type ? screenshot.type : 'png'
screenshot.fullPage = screenshot.fullPage === undefined ? true : boolean(screenshot.fullPage)

if (!/^https?:\/\/.+/.test(option.url)) {
ctx.body = Boom.badRequest('invalid url').output
Expand Down

0 comments on commit 631b732

Please sign in to comment.