Commit Graph

13 Commits

Author SHA1 Message Date
3cb32c5ec9
Sub-path implemented, now you can make a sub for a section using Router's Sub(root) method and then write only what this section contains. Like s := Sub("/api/v1") and then s.Handler("/"). 2023-08-11 18:42:28 +04:00
0717a2e3d3
In case a path continues, but no child was found then break out of main for loop.
It was a bug that when there are children in the next node, but no parameterised one,  having a non-existent path element caused the main loop to continue and firing an if pathLen == i+1 case like if there was a legit node found.
2023-08-11 18:36:13 +04:00
33de30fe23
Sanitise double slashes, and return nil in get() if a path continues but a node doesn't have children. 2023-07-23 23:19:58 +04:00
2bfaae11f2
Fixed a typo in get(). 2023-05-28 03:18:15 +04:00
257bd7ea76
Check if param names differ. 2023-05-28 03:17:53 +04:00
653bae85f5
Changed comment for Param(). 2023-05-28 03:16:41 +04:00
4f54ab4156
Found and fixed a typo. n -> curNode. 2023-05-28 02:43:09 +04:00
9cda541108
Made ServeStatic() to return an error. 2023-05-28 01:49:21 +04:00
89c2333a4f
get and add methods get rewritten in an iterative manner instead of recursive. 2023-05-28 01:46:57 +04:00
538f1bd676
Removed / check that is performed in newPath. Return Not Acceptable if a path not starting with /. 2023-05-28 01:29:01 +04:00
a0b80ced85
Let Handler() return an error instead of panicking. Also removed checks for / and * since they are checked in newPath(). 2023-05-28 01:24:18 +04:00
99a7cebd0a
Perform checks for / and * inside a newPath func. 2023-05-28 01:22:28 +04:00
5d7d595df3
Init repo! 2023-05-26 04:06:35 +04:00