Created
April 27, 2020 16:03
-
-
Save yaasita/43b97ee5e9c944d6ec3867c85b2bad50 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env node | |
"use strict"; | |
const fs = require("fs"); | |
const req = { | |
method: "POST", | |
headers: { | |
host: "localhost:3000", | |
"user-agent": "curl/7.68.0", | |
accept: "*/*", | |
"content-length": "141", | |
"content-type": | |
"multipart/form-data; boundary=------------------------b20c7a8df274bf9e", | |
}, | |
rawBody: fs.readFileSync("./raw-post-data"), | |
}; | |
const res = { | |
status: (c) => { | |
console.log(`status code = ${c}`); | |
return { | |
send: (s) => { | |
console.log(`send: ${s}`); | |
}, | |
}; | |
}, | |
}; | |
(async () => { | |
const lambda = require("./index.js"); | |
console.log("start"); | |
const result = await lambda.handler(req, res); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment