File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,5 @@ npm-debug.log
43
43
44
44
.env
45
45
.deliver /releases /
46
+
47
+ .elixir_ls /
Original file line number Diff line number Diff line change @@ -31,4 +31,4 @@ import_config "#{Mix.env()}.exs"
31
31
32
32
config :instaghub ,
33
33
redis_uri: "redis://localhost:6379" ,
34
- redis_ttl: 9000
34
+ redis_ttl: 31536000
Original file line number Diff line number Diff line change @@ -11,9 +11,21 @@ defmodule InstaghubWeb.Router do
11
11
plug :fetch_flash
12
12
plug :protect_from_forgery
13
13
plug :put_secure_browser_headers
14
+ plug :redirect_to_index
14
15
plug Cache , [ ]
15
- plug QPS
16
- plug :dec_qps
16
+ # plug QPS
17
+ # plug :dec_qps
18
+ end
19
+
20
+ def redirect_to_index ( % Plug.Conn { request_path: "/" <> path } = conn , _opts ) when path != "" do
21
+ conn
22
+ |> Plug.Conn . put_status ( :moved_permanently )
23
+ |> Phoenix.Controller . redirect ( to: "/" )
24
+ |> Plug.Conn . halt
25
+ end
26
+
27
+ def redirect_to_index ( % Plug.Conn { request_path: "/" } = conn , _opts ) do
28
+ conn
17
29
end
18
30
19
31
def dec_qps ( conn , _opts ) do
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ defmodule Instaghub.MixProject do
4
4
def project do
5
5
[
6
6
app: :instaghub ,
7
- version: "0.1.9 " ,
7
+ version: "0.2.0 " ,
8
8
elixir: "~> 1.5" ,
9
9
elixirc_paths: elixirc_paths ( Mix . env ( ) ) ,
10
10
compilers: [ :phoenix , :gettext ] ++ Mix . compilers ( ) ,
You can’t perform that action at this time.
0 commit comments