Discussion
Loading...

#Tag

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
alcinnz boosted
codeDude :archlinux: :neovim:
codeDude :archlinux: :neovim:
@codeDude@floss.social  ·  activity timestamp 2 months ago

I applied to a #RubyOnRails with #NodeJS position.
The funny think is I have almost 3 moths in the company, I didn't touch any Ruby or nodejs projects.
But now I learned #nestjs #kubernetes #Scala and #grpc hahaha

  • Copy link
  • Flag this post
  • Block
codeDude :archlinux: :neovim:
codeDude :archlinux: :neovim:
@codeDude@floss.social  ·  activity timestamp 2 months ago

I applied to a #RubyOnRails with #NodeJS position.
The funny think is I have almost 3 moths in the company, I didn't touch any Ruby or nodejs projects.
But now I learned #nestjs #kubernetes #Scala and #grpc hahaha

  • Copy link
  • Flag this post
  • Block
Emelia 👸🏻
Emelia 👸🏻
@thisismissem@hachyderm.io  ·  activity timestamp 5 months ago
@Shini92 not bad if you like that pattern? Have you seen @adonisframework with its dependency injection stuff?

I know there's some folks in that community that like the spring boot style decorators for declaring routes and stuff

Shini92 :ablobblewobble:
Shini92 :ablobblewobble:
@Shini92@mas.to replied  ·  activity timestamp 5 months ago
@thisismissem @adonisframework Yes, I saw it, but it sadly uses uses also old style decorators from TS with `emitDecoratorMetadata: true`.
My implementation does not use `emitDecoratorMetadata: true`!

I also orientate myself currently a bit between #nestjs, #quarkus and #springboot.

  • Copy link
  • Flag this comment
  • Block
Shini92 :ablobblewobble:
Shini92 :ablobblewobble:
@Shini92@mas.to  ·  activity timestamp 5 months ago

I'm working on a #poc in plain #nodejs 👀
Not published yet, put maybe I will fight #nestjs as a competitor 🤔

This is already working AND fully written in #es2025 #esm with #tc39 decorator proposal

What do you think?

```ts
const cats: Cat[] = [
  new Cat({ id: "1aefd497-bb47-47e3-b160-cb69c5ba0ff4", name: "Kami", age: 4 }),
];

@Path("/cats")
export class CatController {
  @Get
  @Path("/")
  public list(): Cat[] {
    return cats;
  }

  @Get
  @Path("/:id")
  public getById(@PathVariable() id: UUID): Cat | null {
    return cats.find((cat) => cat.id === id) ?? null;
  }

  @Post
  @Path("/")
  public create(@RequestBody(Cat) cat: Cat): Cat {
    cat.id = randomUUID();
    cats.push(cat);
    return cat;
  }

  @Put
  @Path("/:id")
  public update(@PathVariable() id: UUID, @RequestBody(Cat) cat: Cat): Cat {
    const index = cats.findIndex((c) => c.id === id);
    if (index === -1) {
      throw new NotFoundResponseError("Cat not found");
    }
    cats[index] = cat;
    return cat;
  }

  @Delete
  @Path("/:id")
  public delete(@PathVariable() id: UUID): void {
    const index = cats.findIndex((c) => c.id === id);
    if (index === -1) {
      throw new NotFoundResponseError("Cat not found");
    }
    cats.splice(index, 1);
  }
}
```
```ts const cats: Cat[] = [ new Cat({ id: "1aefd497-bb47-47e3-b160-cb69c5ba0ff4", name: "Kami", age: 4 }), ]; @Path("/cats") export class CatController { @Get @Path("/") public list(): Cat[] { return cats; } @Get @Path("/:id") public getById(@PathVariable() id: UUID): Cat | null { return cats.find((cat) => cat.id === id) ?? null; } @Post @Path("/") public create(@RequestBody(Cat) cat: Cat): Cat { cat.id = randomUUID(); cats.push(cat); return cat; } @Put @Path("/:id") public update(@PathVariable() id: UUID, @RequestBody(Cat) cat: Cat): Cat { const index = cats.findIndex((c) => c.id === id); if (index === -1) { throw new NotFoundResponseError("Cat not found"); } cats[index] = cat; return cat; } @Delete @Path("/:id") public delete(@PathVariable() id: UUID): void { const index = cats.findIndex((c) => c.id === id); if (index === -1) { throw new NotFoundResponseError("Cat not found"); } cats.splice(index, 1); } } ```
```ts const cats: Cat[] = [ new Cat({ id: "1aefd497-bb47-47e3-b160-cb69c5ba0ff4", name: "Kami", age: 4 }), ]; @Path("/cats") export class CatController { @Get @Path("/") public list(): Cat[] { return cats; } @Get @Path("/:id") public getById(@PathVariable() id: UUID): Cat | null { return cats.find((cat) => cat.id === id) ?? null; } @Post @Path("/") public create(@RequestBody(Cat) cat: Cat): Cat { cat.id = randomUUID(); cats.push(cat); return cat; } @Put @Path("/:id") public update(@PathVariable() id: UUID, @RequestBody(Cat) cat: Cat): Cat { const index = cats.findIndex((c) => c.id === id); if (index === -1) { throw new NotFoundResponseError("Cat not found"); } cats[index] = cat; return cat; } @Delete @Path("/:id") public delete(@PathVariable() id: UUID): void { const index = cats.findIndex((c) => c.id === id); if (index === -1) { throw new NotFoundResponseError("Cat not found"); } cats.splice(index, 1); } } ```
  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct