4229e5859a
Former-commit-id: 23e21f5e6317c6f47f1ff8e0565480266d9006f5 |
||
---|---|---|
.. | ||
authentication | ||
configuration | ||
convert-handlers | ||
file-server | ||
hello-world | ||
http_request | ||
http_responsewriter | ||
http-listening | ||
miscellaneous | ||
overview | ||
routing | ||
subdomains | ||
testing/httptest | ||
tutorial | ||
view | ||
README.md |
Examples
Please do learn how net/http std package works, first.
This folder provides easy to understand code snippets on how to get started with iris micro web framework.
It doesn't always contain the "best ways" but it does cover each important feature that will make you so excited to GO with iris!
Overview
HTTP Listening
- Common, with address
- UNIX socket file
- TLS
- Letsencrypt (Automatic Certifications)
- Custom TCP Listener
- Custom HTTP Server
- Graceful Shutdown
Configuration
Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context
- Overview
- Basic
- Custom HTTP Errors
- Dynamic Path
- Reverse routing
- Custom wrapper
- Custom Context
- Route State
Subdomains
Convert http.Handler/HandlerFunc
- From func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- From http.Handler or http.HandlerFunc
View
Engine | Declaration |
---|---|
template/html | iris.HTML(...) |
django | iris.Django(...) |
handlebars | iris.Handlebars(...) |
amber | iris.Amber(...) |
pug(jade) | iris.Pug(...) |
- Overview
- Hi
- A simple Layout
- Layouts:
yield
andrender
tmpl funcs - The
urlpath
tmpl func - The
url
tmpl func - Inject Data Between Handlers
- Embedding Templates Into App Executable File
Authentication
File Server
- Favicon
- Basic
- Embedding Files Into App Executable File
- Send/Force-Download Files
- Single Page Applications
How to Read from context.Request() *http.Request
The
context.Request()
returns the same *http.Request you already know, these examples show some places where the Context uses this object. Besides that you can use it as you did before iris.
How to Write to context.ResponseWriter() http.ResponseWriter
The
context.ResponseWriter()
returns an enchament version of a http.ResponseWriter, these examples show some places where the Context uses this object. Besides that you can use it as you did before iris.
Miscellaneous
- Request Logger
- Localization and Internationalization
- Recovery
- Profiling (pprof)
- Internal Application File Logger
More
https://github.com/kataras/iris/tree/master/middleware#third-party-handlers
Testing
The httptest
package is your way for end-to-end HTTP testing, it uses the httpexpect library created by our friend, gavv.
Caching
iris cache library lives on its own package: https://github.com/kataras/iris/tree/master/cache it contains examples
Sessions
iris session manager lives on its own package: https://github.com/kataras/iris/tree/master/sessions it contains examples
You're free to use your own favourite sessions package if you'd like so.
Websockets
iris websocket library lives on its own package: https://github.com/kataras/iris/tree/master/websocket it contains examples
You're free to use your own favourite websockets package if you'd like so.
Typescript Automation Tools
typescript automation tools have their own repository: https://github.com/kataras/iris/tree/master/typescript it contains examples
I'd like to tell you that you can use your favourite but I don't think you will find such a thing anywhere else.
Hey, You!
Developers should read the godocs for a better understanding.
Psst, I almost forgot; do not forget to star or watch the project in order to stay updated with the latest tech trends, it never takes more than a second!