Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ctx): add html method #246

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/rest-api-application/request-context.mdx
Original file line number Diff line number Diff line change
@@ -246,6 +246,17 @@ Route.get('/welcome', ({ response }) => {
})
```

#### The `html()` method

Terminate the request rendering an HTML string in the response
body to the client:

```typescript
Route.get('/welcome', ({ response }) => {
response.html('<h1>Hello World!</h1>')
})
```

#### The `view()` method

Terminate the request rendering a view in the response
3 changes: 1 addition & 2 deletions docs/rest-api-application/web-application.mdx
Original file line number Diff line number Diff line change
@@ -115,8 +115,7 @@ default value inside the `vite.config.ts` file.

With this option set, SSR will be turn on into your application.
This defines where Vite needs to look when compiling your server
entrypoint files and when searching for the default entrypoint to
render when using `response.render()` method.
entrypoint files.

Default: `src/resources/app/app.tsx`