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.

Extracting Express in a seperate module

See original GitHub issue

Big fan of this this framework, good work! I created a REST API with it and it works like a charm.

My use case is an application, which has nothing to do with an webserver. Its a standalone application. Now it would be really nice to still use decorators like @Component or @Module etc. If I would want to have these features, I have to use @nestjs/core as dependency in my application. Now I have the dependency express, even though my application does not even need it.

It would be nice to split the functionality of all the webserver-stuff in a seperate module. For me atleast, that would fit the pattern. Want NestJS? Install @nestjs/core. Need a webserver? Install @nestjs/web. Need websockets? Install @nestjs/websocket Need an orm? Install @nestjs/typeorm

Are there any plans to extract express in an seperate module?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:40 (33 by maintainers)

github_iconTop GitHub Comments

12reactions
kamilmysliwieccommented, Apr 20, 2018

Hi @BrunnerLivio, With v5.0.0 you’ll be able to use various (now express/fastify) adapters. This feature makes Nest a bit more portable and extensible so far. However, the plan is to completely extract express within v6.0.0 which is the next major release. Thanks for convincing me 🙂

8reactions
wbhobcommented, Sep 28, 2018

I think we’re taking this idea of “breaking api” too seriously. Things break between major versions, and it’s for the overall, long-term improvement of the library. As long as we’re offering adequate commnunity support (migration guides and explanations, primarily), I think devs will appreciate a cleaner design.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refactoring similar routes in Express, extracting callbacks to ...
I have separated my routes into different modules. However, there still is a fair amount of duplication. Are there some good practices and ......
Read more >
Node.js Modules: Import and use Functions from Another File
A module can be edited or debugged separately making it easier for you to add or remove new features.
Read more >
Express routing across files (module.exports) - Node.js Tutorial 7
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it.
Read more >
How to Export and Require Modules in NodeJS - YouTube
This tutorial explains the default method of exporting modules and then importing / requiring them inside your projects.
Read more >
How To Import and Export Modules in Node.js Tutorial
In this tutorial, you'll learn how to import modules in Node.js and also ... using the module.exports syntax and then import it into...
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