File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change
1
+ package api
2
+
3
+ import (
4
+ "net/http"
5
+
6
+ "github.com/labstack/echo/v4"
7
+ )
8
+
9
+ func Index (c echo.Context ) error {
10
+ return c .String (http .StatusOK , "Hello, World!" )
11
+ }
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "net/http"
5
-
6
4
"github.com/labstack/echo/v4"
7
5
"github.com/labstack/echo/v4/middleware"
6
+
7
+ "github.com/SeungyoungYang/Go-dev/api"
8
8
)
9
9
10
10
func main () {
@@ -16,13 +16,8 @@ func main() {
16
16
e .Use (middleware .Recover ())
17
17
18
18
// Routes
19
- e .GET ("/" , hello )
19
+ e .GET ("/" , api . Index )
20
20
21
21
// Start server
22
22
e .Logger .Fatal (e .Start (":1323" ))
23
23
}
24
-
25
- // Handler
26
- func hello (c echo.Context ) error {
27
- return c .String (http .StatusOK , "Hello, World!" )
28
- }
You can’t perform that action at this time.
0 commit comments