-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new routes for newservice API
- Added GET route for /kuromi/ - Added POST route for /kuromi/
- Loading branch information
Alonza0314
committed
Aug 31, 2024
1 parent
daf57a1
commit 7a2d69f
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package sbi | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
func (s *Server) getKuromiRoute() []Route { | ||
return []Route{ | ||
{ | ||
Name: "Hello KUROMI", | ||
Method: http.MethodGet, | ||
Pattern: "/", | ||
APIFunc: func(c *gin.Context) { | ||
c.JSON(http.StatusOK, "Hello Kuromi!") | ||
}, | ||
// Use | ||
// curl -X GET http://127.0.0.163:8000/kuromi/ -w "\n" | ||
}, | ||
} | ||
} | ||
|
||
func (s *Server) postKuromiRoute() []Route { | ||
return []Route{ | ||
{ | ||
Name: "Big KUROMI", | ||
Method: http.MethodPost, | ||
Pattern: "/", | ||
APIFunc: func(c *gin.Context) { | ||
c.String(http.StatusOK, "⣴⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⡷\n⠈⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣶⣿⣿\n⠀⢸⣿⣿⣿⣿⣷⣆⣀⣀⣀⣀⣀⣾⣿⣿⣿⣿⡇\n⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇\n⠀⠀⠿⢿⣿⣿⣿⣿⡏⡀⠀⡙⣿⣿⣿⣿⣿⠛\n⠀⠀⠀⣿⣿⣿⡿⠟⠷⣅⣀⠵⠟⢿⣿⣿⣿⡆\n⠀⠀⠀⣿⣿⠏⢲⣤⠀⠀⠀⠀⢠⣶⠙⣿⣿⠃\n⠀⠀⠀⠘⢿⡄⠈⠃⠀⢐⢔⠀⠈⠋⢀⡿⠋\n⠀⠀⠀⢀⢀⣼⣷⣶⣤⣤⣭⣤⣴⣶⣍\n⠀⠀⠀⠈⠈⣈⢰⠿⠛⠉⠉⢻⢇⠆⣁⠁\n⠀⠀⠀⠀⠀⠑⢸⠉⠀⠀⠀⠀⠁⡄⢘⣽⣿\n⠀⠀⠀⠀⠀⠀⡜⠀⠀⢰⡆⠀⠀⠻⠛⠋\n⠀⠀⠀⠀⠀⠀⠑⠒⠒⠈⠈⠒⠒⠊") | ||
}, | ||
// Use | ||
// curl -X POST http://127.0.0.163:8000/kuromi/ -w "\n" | ||
}, | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters