Skip to content

Instantly share code, notes, and snippets.

@yaasita
Created April 27, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaasita/43b97ee5e9c944d6ec3867c85b2bad50 to your computer and use it in GitHub Desktop.
Save yaasita/43b97ee5e9c944d6ec3867c85b2bad50 to your computer and use it in GitHub Desktop.
#!/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