walkor / webman-framework

webman-framework
116 stars 57 forks source link

改进url解析需要多次遍历目录文件的问题,大幅提升性能。 #85

Closed kaoson closed 1 year ago

kaoson commented 1 year ago

优化了guessControllerAction(),getController()等相关代码,避免遍历目录,直接判断文字是否存在。不过目录名需要一定规范,比如url为/some-other/get-some-data,则some-other对应目录名应为some-other,而不是someother,SomeOther等 。

walkor commented 1 year ago

目录名应该不会有 some-other,因为它不好做命名空间。 但是可能会是someOther,所以目录得支持someOther可以被some-other访问