You can use the to return HTML pages. You can copy the URL by using the menu and selecting Endpoints > Copy web endpoint.Web API
Click on this URL to view the above Val: https://neverstew-webHTMLExample.web.val.run?name=Steve.
Using Markdown
By importing a markdown library like Marked, you can render markdown to HTML.
View the result by clicking on this URL: https://neverstew-handleDiscordNewUser.web.val.run
React With Server-Side Rendering (SSR)
You can import ReactDOMServer
from the react-dom/server
module to perform server-side rendering with React.
Note: JSX is not supported yet.
ReactDOMServer.renderToString
converts the TodoList
component into HTML which is sent to the client as the initial server response, which you can view here: https://neverstew-reactSSRExample.web.val.run