development:goravel
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:goravel [2024/11/27 14:16] – tungnt | development:goravel [2024/11/28 05:04] (current) – [Middleware] tungnt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
https:// | https:// | ||
Line 91: | Line 91: | ||
< | < | ||
- | [program: | + | [program: |
process_name=%(program_name)s_%(process_num)02d | process_name=%(program_name)s_%(process_num)02d | ||
- | command=go run / | + | ;command=/ |
+ | command=/ | ||
directory=/ | directory=/ | ||
autostart=true | autostart=true | ||
Line 99: | Line 100: | ||
user=tungnt | user=tungnt | ||
redirect_stderr=true | redirect_stderr=true | ||
- | stdout_logfile=/ | + | stdout_logfile=/ |
stopwaitsecs=3600 | stopwaitsecs=3600 | ||
</ | </ | ||
Line 139: | Line 140: | ||
</ | </ | ||
- | ====== | + | ====== |
+ | ===== Controllers ===== | ||
+ | |||
+ | < | ||
+ | go run . artisan make: | ||
+ | |||
+ | go run . artisan make: | ||
+ | </ | ||
+ | |||
+ | ===== Middleware ===== | ||
+ | |||
+ | <code go> | ||
+ | go run . artisan make: | ||
+ | </ | ||
+ | |||
+ | <file go app/ | ||
+ | package http | ||
+ | |||
+ | import ( | ||
+ | " | ||
+ | |||
+ | " | ||
+ | ) | ||
+ | |||
+ | type Kernel struct { | ||
+ | } | ||
+ | |||
+ | // The application' | ||
+ | // These middleware are run during every request to your application. | ||
+ | func (kernel Kernel) Middleware() []http.Middleware { | ||
+ | return []http.Middleware{ | ||
+ | middleware.ApiAuth(), | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <file go routes/ | ||
+ | import " | ||
+ | |||
+ | facades.Route().Middleware(middleware.Auth()).Get(" | ||
+ | </ | ||
+ | |||
+ | ===== Request ===== | ||
+ | |||
+ | < | ||
+ | go run . artisan make: | ||
+ | </ | ||
+ | |||
+ | ===== Rule ===== | ||
+ | |||
+ | < | ||
+ | go run . artisan make:rule Uppercase | ||
+ | </ |
development/goravel.1732716989.txt.gz · Last modified: 2024/11/27 14:16 by tungnt