mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-18 21:45:12 +00:00
Merge pull request #105 from thgh/patch-2
Fix route not found when url is /?
This commit is contained in:
@@ -125,7 +125,7 @@ function connect_prod() {
|
|||||||
export default dev ? connect_dev : connect_prod;
|
export default dev ? connect_dev : connect_prod;
|
||||||
|
|
||||||
function set_req_pathname(req, res, next) {
|
function set_req_pathname(req, res, next) {
|
||||||
req.pathname = req.url.replace(/\?.+/, '');
|
req.pathname = req.url.replace(/\?.*/, '');
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,4 +279,4 @@ function try_serialize(data) {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user