Skip to content
Myr

Feature/redirect (#36)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Add redirect method * Make Headers type * Typecheck

authored by Yusuke Wada · committed by Yusuke Wada · parent f9fa200 · Browse files · 4 files+44 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+44 added−8 removed

  • tests:+6 added−0 removed
  • other:+38 added−8 removed

4 files+44 added−8 removed

modified:example/basic/index.js+10 added-4 removed
modified:src/context.ts+18 added-3 removed
modified:test/context.test.ts+6 added
modified:README.md+10 added-1 removed
261 unmodified lines
262263Render HTML as `Content-Type:text/html`:264265```js266app.get('/api', (c) => {266app.get('/', (c) => {267 return c.html('<h1>Hello! Hono!</h1>')268})269```270271### c.redirect()272273Redirect, default status code is `302`:274275```js276app.get('/redirect', (c) => c.redirect('/'))277app.get('/redirect-permanently', (c) => c.redirect('/', 301))278```279280## fire281282`app.fire()` do:283
105 unmodified lines