Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Serverless Pre-Rendering Without Next.js #115

Locked Answered by coetry
LearnWebCode asked this question in Help
Discussion options

You must be logged in to vote

Hi @LearnWebCode You can return an HTML string from the function and set the appropriate content-type

module.exports = (req, res) => {
  res.setHeader('content-type', 'text/html')
  res.setHeader('cache-control', 's-maxage=3600, stale-while-revalidate')
  res.send(`
    <html>
      <body><h1>yo</h1></body>
    </html>
  `)
}

Replies: 0 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@LearnWebCode
Comment options

@LearnWebCode
Comment options

@cpresler
Comment options

@claudionunezjr
Comment options

@Pieparker
Comment options

Answer selected by Pieparker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
5 participants