Skip to content

Instantly share code, notes, and snippets.

@MarcL
Created June 2, 2020 19:48
Show Gist options
  • Save MarcL/c2d206ea376d02d0c2f741a5771ad296 to your computer and use it in GitHub Desktop.
Save MarcL/c2d206ea376d02d0c2f741a5771ad296 to your computer and use it in GitHub Desktop.
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