-
Notifications
You must be signed in to change notification settings - Fork 60
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: Added CORS to config #302
Conversation
] | ||
} | ||
}, | ||
|
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.
I thought it might be useful to show the CORS config in an example project, so I've left this in here for now.
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.
Great idea!
@@ -103,7 +104,8 @@ export default async function initialize<T: Application>(app: T, { | |||
|
|||
const server = new Server({ |
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.
I think it would be beneficial to spread the serverOpts
here:
const server = new Server({
...serverOpts,
router,
logger
});
👏 Awesome work! I have a few suggestions regarding style and structure but functionally speaking this on point! |
|
||
import type { Writable } from 'stream'; | ||
import type { IncomingMessage, Server as HTTPServer } from 'http'; | ||
|
||
import type { Request } from './request/interfaces'; | ||
import type { Response } from './response/interfaces'; | ||
import type { Server$opts } from './interfaces'; | ||
import type { Server$config } from './interfaces'; |
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.
We can condense this import down to a single line:
import type { Server$opts, Server$config } from './interfaces';
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.
Ugh, yes!
Almost there! |
This LGTM. Awesome work! 😃 |
P.S: |
This pull request adds the ability to configure CORS headers via the config. There's a lot of new-to-me work on this one in terms of Flow, so I'm including some notes.
Closes #282