Skip to content

How to access env from router.post? #126

Answered by kwhitley
OkenKhuman asked this question in Q&A
Discussion options

You must be logged in to vote

Link is right there! :)
https://github.com/kwhitley/itty-router#cf-es6-module-syntax

Basically, anything you pass into a router.handle will be the args presented to each handler downstream. If you pass in all the ...args from cloudflare's fetch, env will naturally be the second param, and context the third. Otherwise, it's all up to you!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kwhitley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants