Docs
Return HTML Page

Return HTML Page

main.ts
import { Server } from 'websi'
import { GET } from 'websi/route'
import * as Response from 'websi/response'
 
const HTMLPage = `<!DOCTYPE html>
<body>
  <h1>Hello Websi</h1>
  <p>This HTML page was created using Websi</p>
</body>`;
 
const routes = [
  GET('/', () => Response.HTML(HTMLPage))
]
 
const server = Server(routes)
export default server