2016-03-06 19:52:32 +02:00
|
|
|
---
|
|
|
|
title: Migrating
|
|
|
|
menu:
|
|
|
|
side:
|
|
|
|
parent: guide
|
|
|
|
weight: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
### Migrating from v1
|
|
|
|
|
2016-03-08 18:14:25 +02:00
|
|
|
#### Change log
|
2016-03-06 19:52:32 +02:00
|
|
|
|
|
|
|
- Echo now uses `Engine` interface to abstract `HTTP` server implementation, allowing
|
2016-03-08 18:14:25 +02:00
|
|
|
us to use HTTP servers beyond the standard library. It currently supports standard HTTP server and [FastHTTP](https://github.com/valyala/fasthttp).
|
|
|
|
- Context, Request and Response are converted to interfaces. [More...](https://github.com/labstack/echo/issues/146)
|
2016-03-06 19:52:32 +02:00
|
|
|
- Moved API's for serving static files into middleware.
|
|
|
|
- `Echo#Index`
|
|
|
|
- `Echo#Favicon`
|
|
|
|
- `Echo#Static`
|
|
|
|
- `Echo#ServeDir`
|
|
|
|
- `Echo#ServeFile`
|
|
|
|
- Dropped auto wrapping of handler and middleware to enforce compile time check.
|
|
|
|
- Handler only accepts `Echo#Handler` interface.
|
|
|
|
- Middleware only accepts `Echo#Middleware` interface.
|
|
|
|
- `Echo#HandlerFunc` adapter to use of ordinary functions as handlers.
|
|
|
|
- `Echo#MiddlewareFunc` adapter to use of ordinary functions as middleware.
|
|
|
|
- Middleware is run before hitting the router, which doesn't require `Echo#Hook` API as
|
|
|
|
it can be achieved via middleware.
|
|
|
|
- Ability to define middleware at route level.
|
|
|
|
|
|
|
|
#### How?
|