question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Separate server and app initialization into two parts (optional)

See original GitHub issue

Opening a new issue for this idea. This conversation originally started on #56. Relevant comment below.

@peterwillis

The way I have middleware setup also makes it difficult for the same reason. I totally understand why you have done it the way you have for the most convenient case. In the middleware chain I have, there is no good place where server and app are available together at a point where the routing can be changed. All the middleware for the app is setup in advance including the error handling and this is a separate module. This module is then required by the serving module, which decides whether it should start an HTTP or HTTPS server for the app. Is it possible to separate out where the route is added so that I can do it in two steps? So I would have to add code in two places for reload to work in this way:

during routing: reload.configureRoute(app)

then another function that wouldn’t need the app: reload.websocketServer(server)

I think the module would need another way to instantiate so it wasn’t always returning the single function. I can put together a PR if you think it is feasible to include it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
peterwilliscommented, May 1, 2017

Resolved by c00ac1a4b00551885d4876c796a9f9cc8080b363 in pull request #71

1reaction
peterwilliscommented, Apr 23, 2017

If I needed it to work that way, I could just use the venerable webpack-dev-server. The way that fork works is hijacking the way static content is served which won’t work for my middleware chain. Using this package means you can use the express static middleware.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Initialization <applicationInitialization>
The default value is false . Optional string attribute. Specifies a page to remap a request to during application initialization.
Read more >
Use IIS Application Initialization for keeping ASP.NET Apps alive
In this particular app there are two components that run in the background on their own threads: A scheduler that runs various scheduled...
Read more >
Working with Initialization Blocks
Initialization blocks are used to initialize dynamic repository variables, system session variables, and nonsystem session variables.
Read more >
“How-to” Guides
The first thing you can do to help it is to leave server-related dependencies ... A separate Environment property source is set up...
Read more >
Configure multiple projects | Firebase - Google
This object is initialized as part of your normal setup. However, when you want to access multiple projects from a single application, you'll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found