Skip to content

Conversation

@nergmada
Copy link

@nergmada nergmada commented Dec 3, 2020

Allow overriding Router

I was trying to follow the example in the HttpServer example to set this up but a few parts kept bugging. Namely that require('router') is not a function. I don't know if this works on other systems and is just a by product of using webpack to package a server, but I've added

config.router so that you can specify the direct expressjs import by doing

import {Router} from 'express';
import hazel from 'hazel-server';
const server = hazel({
//other details
  router: Router
})

It'll still default to the 'router' package if the config.router option isn't specified.

Switch node-fetch for cross-fetch

I know cross-fetch is worse because it's basically a super polyfill for node and browsers without the Fetch API, but node-fetch doesn't seem to work with webpacking either, so I figured that I'd bring a sledgehammer to hammer a nail

@vercel
Copy link

vercel bot commented Dec 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/hazel/ewq49noe7
✅ Preview: https://hazel-git-master.vercel.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant