Code Monkey home page Code Monkey logo

Comments (3)

Himself65 avatar Himself65 commented on July 19, 2024 2

someone could change this line to
this._prefix + method and add a new decorator named "prefix" and add _prefix field to the target class

https://github.com/daruk-framework/daruk/blob/ef2e002d2feb48575f02587e36fb67720b49260a/src/decorators/http_methods.ts#L68

from daruk.

xiaojue avatar xiaojue commented on July 19, 2024 1

it like a prefix controller decorator.

// src/controllers/contact/list.ts
import { BaseController, get, Context, version } from "daruk";

@prefixPath('/v1')
export default class ContactList extends BaseController {
  @get("/")
  public async getContactList(ctx: Context, next: Function) {
    ctx.body = "contact list";
    return next();
  }
}

the router path use with @prefixPath decorator will be /v1/contact/list, it's should be better ?

from daruk.

xiaojue avatar xiaojue commented on July 19, 2024

7a48705

@Chersquwn next version will be available

from daruk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.