@yumerijs/core 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context.js +5 -1
- package/package.json +1 -1
package/dist/context.js
CHANGED
|
@@ -57,7 +57,11 @@ export class Context {
|
|
|
57
57
|
* @returns Route 实例
|
|
58
58
|
*/
|
|
59
59
|
route(routepath) {
|
|
60
|
-
|
|
60
|
+
// `root` is a special fallback route name, not a filesystem path.
|
|
61
|
+
// URL paths must use POSIX separators even when Yumeri runs on Windows.
|
|
62
|
+
const realpath = routepath === 'root'
|
|
63
|
+
? 'root'
|
|
64
|
+
: path.posix.join(this.childpath, routepath);
|
|
61
65
|
if (this.core.routes[realpath]) {
|
|
62
66
|
this.core.logger.warn(`Plugin "${this.pluginname}" attempt to register route "${path}", but it has already been registered.`);
|
|
63
67
|
return new Route(realpath, this);
|