1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
Commit Graph

50 Commits

Author SHA1 Message Date
toimtoimtoim
1b1a68fd4f Improve filesystem support (Go 1.16+). Add field echo.Filesystem, methods: echo.FileFS, echo.StaticFS, group.FileFS, group.StaticFS. Following methods will use echo.Filesystem to server files: echo.File, echo.Static, group.File, group.Static, Context.File 2022-01-24 15:55:16 +02:00
toimtoimtoim
655596b1b9 Revert "Remove group.Use registering Any routes that break other routes"
This reverts commit f72eaa42
2020-12-17 02:01:59 +02:00
Segev Finer
f72eaa4253 Remove group.Use registering Any routes that break other routes
Fixes #1657
2020-11-08 16:33:35 +02:00
Ori Shoshan
c29904d81c
Fixed double padding in Group.File, Group.Add (#1534)
Group.File was padding with g.prefix even though it would later call Group.Add which padded with prefix again - for a total of two times
2020-04-25 10:58:16 -07:00
Vishal Rana
5d2c33ad5d Bumped v4.1.5
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-04-29 22:54:49 -07:00
Vishal Rana
64c6d92295 Fixed group middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-04-29 16:46:08 -07:00
Vishal Rana
4de244c072 Fixed invalid json value for error in logger middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-04-29 13:21:11 -07:00
Vishal Rana
8c13b9dae2 Fixed sub-group virtual hosts 2019-04-28 23:10:00 -07:00
Vishal Rana
6f0a227a5a Built-in capability to run multiple hosts
Signed-off-by: Vishal Rana <vr@labstack.com>
2019-04-28 22:22:35 -07:00
Emir Ribić
c8fd197fa8 Replace http constants with stdlib ones, i.e.: http.MethodGet instead of echo.GET (#1205) 2018-10-14 20:46:58 +05:30
Evgeniy Kulikov
f49d166e6f [FIX] Cleanup code (#1061)
Code cleanup
2018-02-21 10:44:17 -08:00
Vishal Rana
b338075a0f Update dummy group path to include exact prefix
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-12-23 09:11:03 -08:00
Vishal Rana
8e421d9773 Fixed #1019
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-12-22 12:09:52 -08:00
bartoszgolek
1e9845a414 Expose group.add() method for dynamic route registration (#985) 2017-08-08 11:08:13 -07:00
Rene Jochum
0769b34b52 Use the NotFoundHandler when a file haven't been found. (#966)
This is especialy usefull when you use e.Static("/", "static") and you
want a notfoundhandler that serves your index.html like this:

echo.NotFoundHandler = func(c2 echo.Context) error {
	index := filepath.Join(c.config.StaticDir, c.config.Index)
	_, err := os.Open(index)
	if err != nil {
		return echo.ErrNotFound
	}
	return c2.File(path.Join(c.config.StaticDir, c.config.Index))
}

Another usecase with the Handler above is HTML5 SPF applications.

One caveat, you need to make sure that your NotFoundHandler doesn't
produce loops.

Signed-off-by: Rene Jochum <rene@jochums.at>
2017-07-19 11:29:41 -07:00
Nick Law
e0ea129c5c Expose echo.Add() for dynamic route registration (#965) 2017-07-03 19:10:58 -07:00
Miha Valencic
c04b028852 Support route naming and generating URLs based on route names (#960)
* Route registration methods return Route object

* Renamed Route#Handler to Route#Name

* Adding route return value to Any, Match, Static and File methods.
2017-06-22 10:59:02 -07:00
Vishal Rana
6bb7747530 Updated docs
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-03-05 19:08:11 -08:00
Vishal Rana
91d2727522 Fixed #838
Signed-off-by: Vishal Rana <vr@labstack.com>
2017-02-22 13:04:08 -08:00
Vishal Rana
891d8519d7 fixed #701
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-30 15:03:18 -07:00
Vishal Rana
796df515f3 fixed #700
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-30 13:29:37 -07:00
Vishal Rana
58166d599b fixed default routes for group
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-29 22:54:06 -07:00
Vishal Rana
8067b8eaf7 fixed group static
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-25 18:47:11 -07:00
Vishal Rana
4760f4cedf fixed recipes for static middleware change
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-22 16:38:01 -07:00
Vishal Rana
954efac63a fixed #684
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-22 15:18:55 -07:00
Vishal Rana
12573cd76d fixed #675
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-22 12:32:39 -07:00
Vishal Rana
2bdbf6918e fixed #623
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-14 14:52:40 -07:00
Vishal Rana
d5b3fef5c9 removed deprecated functions group.go
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-13 14:04:08 -07:00
Vishal Rana
8623669cbc removed Context#P()
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-10 18:22:13 -07:00
Vishal Rana
e918eacd9d Fixed #622
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-08-11 16:25:03 -07:00
Russ Egan
2eb5d97b19 Fix issue with middleware from one route leaking into the middleware of other routes
Fixed #565

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-06-16 07:29:25 -07:00
Vishal Rana
1c2d6341ba Fixed #474
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-18 16:59:58 -07:00
Vishal Rana
94a16d25a3 Fixed #461
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-11 23:21:32 -07:00
Vishal Rana
130c548826 Closes #459, #457.
- Static back as middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-10 20:56:10 -07:00
Vishal Rana
2f8639b7e6 Just some variable changes
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-09 16:09:50 -07:00
Vishal Rana
33700bfcc2 Fixed #457
- Dropped static middleware in favor of Echo#Static & Echo#StaticConfig.
- Enhanced middleware chaining.

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-09 14:00:23 -07:00
Vishal Rana
b5d6c05101 Fixed #441, #294
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-04-02 14:24:51 -07:00
Vishal Rana
c4caeb8ffb more godoc
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-19 15:47:20 -07:00
Vishal Rana
3abe661e72 Fixed nested group middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-16 20:25:58 -07:00
Vishal Rana
2d6aaa8a33 Fixed #405
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-15 08:33:57 -07:00
Vishal Rana
296498c942 Fixed nested groups, reset Context#handler
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-08 19:31:11 -08:00
Vishal Rana
b97a2c5ad6 Fixed group middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-20 08:11:02 -08:00
Vishal Rana
caf3bd31eb - Handler and middleware signature changed
- Pre chain middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-15 19:32:16 -08:00
Vishal Rana
51acf465fe - Moved static file serving to a new handler package
- Middleware at route level
- Group middleware is a in closure now

Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-15 08:11:29 -08:00
Vishal Rana
33d8813eb5 Revert "Revert "Fixed Request.Out""
This reverts commit 72050d765b.
2015-12-21 15:20:49 -08:00
Vishal Rana
72050d765b Revert "Fixed Request.Out"
This reverts commit cced590a16.
2015-12-21 15:18:53 -08:00
Vishal Rana
cced590a16 Fixed Request.Out
Signed-off-by: Vishal Rana <vishal.rana@verizon.com>
2015-12-21 15:18:03 -08:00
Vishal Rana
ac527ab4da Better implementation for serving static files.
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-27 14:07:52 -07:00
Vishal Rana
e119cbc2ea Separated Group from Echo to limit API
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-22 21:24:35 -07:00
Vishal Rana
e0364caf36 Better handling in middleware for WebSocket
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-05-22 20:26:52 -07:00