-
Notifications
You must be signed in to change notification settings - Fork 109
Add wrangler.toml and fix index.js code #24
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
Conversation
* @param {Request} request | ||
*/ | ||
async function handleRequest(request) { | ||
return new Response('Hello worker!', { status: 200 }) | ||
return new Response('Hello worker!', { | ||
headers: { 'content-type': 'text/plain' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status 200 is the default, so I found that irrelevant. I wanted to include one example of modifying ResponseInit
though and it's best praactice to include Content-type
anyways so I added that
@@ -0,0 +1,7 @@ | |||
name = "helloworld" | |||
type = "javascript" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make default webpack instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. It'd also be great to move index.js
from the top level and create a src
directory and point package.json
:main
to ./src/index.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill make an issue for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
fixes #16
This is the default
wrangler generate
template so all nits welcome 😸