Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

441
Views
NestJs: Is there a way to generate a resource, already wired to a TypeOrm entity?

I'm playing around with NestJs, for the purpose of automating REST API creation as much as possible. So far, I do not see any quick way to create a fully functional resource.

For example, if I use the Nest CLI like this:

nest g resource

And call my resource "posts", I get a module, a controller, a service, dto's and an empty entity

In order to make it functional, I would need to manually go through every method of the PostsService, remove the placeholder, and wire it to the corresponding entity method. For example, this needs to be altered:

findAll() {
    return `This action returns all posts`;
  }

to:

findAll(){
 return this.postsRepository.find()
}

Not to mention, that I need to add various decorators and imports. In my opinion, this undermines the whole idea of CRUD generator. A lot of files are created for me, but they need to be altered.

Is there any way in Nest to create a fully functioning resource(of course i would still need to manually set the fields of the entity), with all parts wired to each other correctly?

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

I also tried to find something similar. And this is the best what I found https://github.com/ashinzekene/generator-nestjs-app I think if such a thing existed, then it should have been mentioned in this repository. https://github.com/nestjs/awesome-nestjs But it's not. Maybe I'm wrong ๐Ÿ˜‘

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!