Code Monkey home page Code Monkey logo

Comments (3)

xiaojue avatar xiaojue commented on August 18, 2024 1

@himself65 koa-router是支持字符串通配符的,所以之前直接传入字符串就可以,如果要加入正则,这里需要做逻辑分支处理,这个地方应该也是引起windows报错的地方,建议windows的router我们下午搞定了,再加这个特性。

from daruk.

xiaojue avatar xiaojue commented on August 18, 2024 1

https://github.com/pillarjs/path-to-regexp#custom-matching-parameters

@get('/(foo|goo)')
async foo(ctx: Daruk.Context) {
  ctx.body = '';
}

查阅了一下,koa-router是基于path-to-regexp这个库,所以是可以通过字符串通配方式进行正则表达式的替换,参考我发的例子,可以实现,所以这个feature可以不加。koa-router也是不支持regexp参数。

from daruk.

himself65 avatar himself65 commented on August 18, 2024

如果加入该特性会和该部分冲突

https://github.com/daruk-framework/daruk/blob/5e80b4cbe935c92b9a092116354b7e61e4fe750a/src/core/daruk_init_module.ts#L185-L193

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.