Skip to content

Instantly share code, notes, and snippets.

@MarcL
Created June 2, 2020 19:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Renders an HTML file using a serverless function (Vercel in my case)
const { readFileSync } = require('fs');
const { join } = require('path');
const html = readFileSync(join(__dirname, './index.html'), 'utf8');
module.exports = (request, response) => {
response.send(html);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment