Commit Graph

53 Commits (v2)

Author SHA1 Message Date
Chris Hurst c955d76f5d
🐛 bug: fix middleware naming and returned values of group methods (#2477)
* Bug fix: route names not updating

* fixed lint error

* updated tests with renaming edge case

* fix group naming partially

* add todo

* fix todo

* fix todo

---------

Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
2023-06-05 13:00:51 +02:00
leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
M. Efe Çetin 8aeb147c75
feature: add multiple-prefix support to app.Use() and group.Use() (#2205) 2022-11-13 16:56:34 +01:00
Rafi Muhammad 878c9549d8
Feat: Register custom methods (#2107)
* Implementing register custom methods

* Return timout time to 1000

* Update app_test.go

* Change update stack to add custom request method

* Feat: Register custom methods #2107

* Feat: Register custom methods #2107

* update logic

* optimization.

* fix

Co-authored-by: Rafi Muhammad <rafi.muhammad@mekari.com>
Co-authored-by: RW <rene@gofiber.io>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
2022-11-11 08:23:30 +01:00
M. Efe Çetin 581af0052d
🐛 bug: fix naming of routes inside groups (#2199)
* 🐛 bug: fix naming of routes inside groups

* fix tests

* bug: fix naming of routes inside groups

Co-authored-by: René Werner <rene@gofiber.io>
2022-11-09 16:03:16 +01:00
M. Efe Çetin 156b81c768
🐛 bug: improve mounting behavior (#2120)
* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* 🐛 bug: fix mounting doesn't work if when to declare it before routes

* add onMount hooks, mountPath like express.js, better behavior for onName, onRoute, onGroup, onGroupName hooks on mounted apps

* add comment

* use once

* fix views when both app and sub-app have view engine, better behavior for mount path

* fix tests

* fix tests

* make some tasks

* make some tasks
2022-10-25 07:51:44 +02:00
Amir Hossein 1d773c7f3c
update code comments for helping IDEs and fix unhandled error in test (#2099)
* fix unhandled errors

* fix unhandled error in cache package test

* omit variable type

* omit variable type

* rename variable because collide with the imported package name

* handle file error on closing

* fix unhandled in common_linux.go

* fix unhandled errors in helpers_test.go

* fix unhandled errors in listen_test.go

* remove unused parameter in emptyHandler method

* refactor path.go

* unhandled error in hooks test

* fix unhandled errors in app_test.go

* fix unhandled errors in ctx_test.go

*  fix unhandled errors in helpers_test.go

* revert app_test.go

* remove redundant parentheses and update comments

* update code comment for helping ide

* update code comment for helping ide

* fix unhandled error in app_test.go

* update code comments for helping IDEs
2022-09-18 15:32:54 +02:00
M. Efe Çetin 6669ec4486
📝 docs: gofmt & add missing copyright texts (#2013) 2022-08-15 20:25:26 +02:00
RW a8f9d4acfb
🐛 Sub fiber's error handlers not working #1839 (#1848)
fix root level bug
2022-04-05 08:40:22 +02:00
M. Efe Çetin bd20e90e6b
feature: add initial support for hooks (#1777)
* Add initial support for hooks.

* release ctx, mutex.

* Add unit tests.

* add comment lines.

* update

* update

* remove unnecessary code.

* fix race condition.

* fix gosec.

* skip error handling for onshutdown and onresponse.

* update

* separate hooks from app.go

* make hooks field private, hook struct public and Hooks() func.

* remove onreq and onres because of they can be done by middlewares.

* OnGroupName method.

* Update hooks.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

* handle errors for name and groupname

* fix tests.

* Update app.go

* use struct fields instead of map

* add multi-handler.

* add onGroup, make prefix field public on Group struct.

* Update hooks.go

* add newhooks method.

*  feature: add initial support for hooks

* remove ctx from hooks.

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
Co-authored-by: wernerr <rene@gofiber.io>
2022-03-10 08:35:15 +01:00
M. Efe Çetin c450072f4a
🐛 fix: mounted app views (#1749)
* Fix mounted app views.

* Cleaner structure.

Co-authored-by: RW <rene@gofiber.io>

* remove unnecessary lines.

* Add test case for group-with-mount, remove unnecessary lines.

Co-authored-by: RW <rene@gofiber.io>
2022-02-06 14:58:45 +01:00
M. Efe Çetin d3c2122086
Fix route naming when to use group in group. (#1736) 2022-01-29 15:26:01 +01:00
M. Efe Çetin 559f59f198
Add Route() method like Chi router. (#1713) 2022-01-24 16:37:28 +01:00
vecpeng ef3a689600
🐛fix: rename handlerCount to handlersCount (#1674) 2021-12-29 10:26:50 +01:00
ichx 637f0c1bba
Fix: error handler of app and its sub apps not saved when mounted in group (#1649) 2021-12-28 14:05:35 +01:00
M. Efe Çetin 68d3b773bc
Add route naming feature. (#1650)
* Add route naming feature.

* Update basicauth_test.go

* Fix gosec issues.

* Change RoutaName -> Name

* Fix race conditions.

* Update READMEs.
2021-12-28 14:04:04 +01:00
Gusted 7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
bestgopher 056c6808af
Use atomic instead of mutex when counting the route handler. (#1314)
* use atomic instead of mutex when counting

* 📒 router: fix typo error
2021-05-05 17:53:54 +02:00
Dario Leittersdorf a28afaae75
🩹Fix: Startup message doesn't show correct amount of Handlers after mounting (#1302)
* fix: pass handlerCount when mounting to an App

* test: check for correct handlerCount after mounting an instance

* fix: pass handlerCount when mounting to a Group

* test: check for correct handlerCount after mounting to a Group

Co-authored-by: dleitter <dario.leittersdorf@bonprix.net>
2021-05-04 09:21:04 +02:00
Kiyon d6d831e2b1 👷 fix lint 2020-11-30 13:49:13 +08:00
kiyon 839c8f1447 👷 fix group.Mount 2020-10-04 00:36:11 +08:00
Fenny 753391b217 🧹 remove old code 2020-09-26 11:25:32 +02:00
Fenny e414c4a83e 🗻 able to mount sub-apps 2020-09-26 11:24:25 +02:00
Fenny ca9c8c632f v2
Co-Authored-By: hi019 <65871571+hi019@users.noreply.github.com>
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
Co-Authored-By: kiyon <kiyon@gofiber.io>
Co-Authored-By: Roger Guldbrandsen <8797880+kinbiko@users.noreply.github.com>
2020-09-14 08:05:34 +02:00
Fenny 3d76f078a4 v2 2020-09-14 04:54:26 +02:00
Fenny ec5d66e7a8 v2 2020-09-13 11:20:11 +02:00
wernerr b9bdc0d4a8 🚀 compress same route's handler 2020-07-20 19:29:54 +02:00
kiyon 174eb0e33d 🚀 compress same route's handler and sort routes when registering 2020-07-20 21:43:01 +08:00
Fenny f9e6ea8103 🖇 Cleanup router chaining 2020-07-19 13:36:26 +02:00
ReneWerner87 1b2d3d92c4 🔗Allow route method chaining
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express-serve-static-core/index.d.ts#L119-L126
2020-07-19 10:04:21 +02:00
Fenny da85c85c14 🧪 Increase test coverage: 96% 2020-07-15 17:43:30 +02:00
kiyon 2cfc1b1546 👷 Extract "USE" to a global const variable 2020-07-12 23:54:22 +08:00
Fenny 7ea6b2a9d0 🧩 Describe HTTP methods 2020-07-06 17:56:03 +02:00
ReneWerner87 d57651835b improve routing performance 2020-06-29 22:51:41 +02:00
wernerr f1710ea1b6 fix the unnecessary pass through for routes with groups 2020-06-19 10:54:15 +02:00
fenny e8b8fdfb35
Add Handler type (#410)
* Add new supporter
* Add new test condition
* Add Handler Type
2020-05-24 16:02:21 +02:00
Fenny f114aad429 Separate group file
Co-Authored-By: RW <renewerner87@googlemail.com>
2020-05-23 09:27:06 +02:00
Fenny f40d786caa v1.8.4
- Remove middleware folder
- Extend travis testing
2020-03-22 01:51:53 +01:00
Fenny c5436a7519 Fix some consts 2020-03-20 16:49:46 +01:00
Fenny b425a5b4bf v1.8.34 2020-03-20 16:43:28 +01:00
Fenny 9657019879 Add more comments 2020-03-16 17:18:25 +01:00
Fenny bec9eecb29 v1.8.32 2020-03-15 14:45:57 +01:00
Fenny 558fcd2f30 v1.8.3 2020-03-14 12:30:21 +01:00
Fenny 21590dffe9 v1.8.2 2020-03-04 12:30:29 +01:00
Fenny d547d441a3 New internal router alpha 2020-03-03 12:21:34 -05:00
Fenny b872361da9 Strong type app.METHODS 2020-02-27 04:10:26 -05:00
Fenny 2eeb40273c v1.8.0 2020-02-26 19:31:43 -05:00
Fenny bf66978a7f Fix comments 2020-02-22 17:03:30 -05:00
Fenny 1991d8db32 🎉 Official v1 Release 2020-02-21 18:07:43 +01:00
Fenny b01e74187c v0.7.0 2020-02-21 18:06:08 +01:00