Created
February 1, 2019 00:44
-
-
Save brianleroux/d239e158f2ce8305acbd5110648fa2a7 to your computer and use it in GitHub Desktop.
maaaaabye this?
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
let next = require('../../front/.next/serverless/pages/index.js') | |
exports.handler = async function http(req) { | |
req.url = req.path | |
let res = {end(){},setHeader(){}} | |
return {type:'text/html; charset=utf8', body: next.render(req,res).html} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running that I can see that the renderReqToHTML function in Next does get the html string, but it's not showing up on the page or in the end(){} function.
I wrote this which is janky as heck, but it gets the right html to the browser. The right html makes it to the res.end() function, but nothing returns. I'm not sure how to mock the real res.end() function