Created
April 7, 2018 04:29
-
-
Save melvinlee/c37cabb342df71045db227edb40f3930 to your computer and use it in GitHub Desktop.
AWS nodejs lamba to return html content from file.
This file contains hidden or 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
'use strict'; | |
var fs = require('fs'); | |
exports.get = function(event, context) { | |
let contents = fs.readFileSync("public/index.html"); | |
context.succeed({ | |
statusCode: 200, | |
body: contents.toString(), | |
headers: {'Content-Type': 'text/html'} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment