Frog.action
Import
import { Frog } from 'frog'Usage
import { Button, Frog } from 'frog'
const app = new Frog()
app.action('/', (c) => {
console.log('Apple and Banana')
return c.res({ message: 'Action Succeeded' })
})Parameters
path
- Type:
string
Path of the route.
import { Button, Frog } from 'frog'
const app = new Frog()
app.action(
'/foo/bar',
(c) => {
console.log('Apple and Banana')
return c.res({ message: 'Action Succeeded' })
}
) handler
- Type:
(c: Context) => ActionResponse
Handler function for the route.
/** @jsxImportSource frog/jsx */
// ---cut---
import { Button, Frog } from 'frog'
const app = new Frog()
app.action(
'/foo/bar',
(c) => {
console.log('Apple and Banana')
return c.res({ message: 'Action Succeeded' })
})
)