挂载前端文件

master
daiao 3 years ago
parent 1fd4aa36ae
commit a77a085c1f

@ -4,12 +4,13 @@
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] Loaded HTML Templates (4):
- jquery-2.1.4.min.js
[GIN-debug] Loaded HTML Templates (3):
-
- index.html
- index.tpl
[GIN-debug] GET /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
[GIN-debug] HEAD /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
[GIN-debug] GET /user/list --> gowebsocket/controllers/user.List (3 handlers)
[GIN-debug] GET /user/online --> gowebsocket/controllers/user.Online (3 handlers)
[GIN-debug] POST /user/sendMessage --> gowebsocket/controllers/user.SendMessage (3 handlers)
@ -18,3 +19,7 @@
[GIN-debug] GET /home/index --> gowebsocket/controllers/home.Index (3 handlers)
[GIN-debug] GET /rtc/get_token --> gowebsocket/controllers/rtc.GetToken (3 handlers)
[GIN-debug] GET /docker/run --> gowebsocket/controllers/docker.Run (3 handlers)
[GIN] 2021/11/23 - 15:06:15 | 404 | 2.762µs | 127.0.0.1 | GET "/"
[GIN] 2021/11/23 - 15:06:21 | 200 | 1.775252ms | 127.0.0.1 | GET "/home/index"
[GIN] 2021/11/23 - 15:06:21 | 200 | 12.021807ms | 127.0.0.1 | GET "/static/js/jquery-2.1.4.min.js"
[GIN] 2021/11/23 - 15:06:22 | 200 | 5.363419ms | 127.0.0.1 | GET "/user/list?appId=101"

@ -9,8 +9,6 @@ package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
"gowebsocket/lib/redislib"
"gowebsocket/routers"
"gowebsocket/servers/grpcserver"
@ -21,6 +19,9 @@ import (
"os"
"os/exec"
"time"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
)
func main() {

@ -13,13 +13,15 @@ import (
"gowebsocket/controllers/rtc"
"gowebsocket/controllers/systems"
"gowebsocket/controllers/user"
"net/http"
"github.com/gin-gonic/gin"
)
func Init(router *gin.Engine) {
router.LoadHTMLGlob("views/**/*")
// 静态文件
router.StaticFS("/static", http.Dir("static/"))
// 用户组
userRouter := router.Group("/user")
{

@ -252,7 +252,7 @@
</form>
</div>
</div>
<script src="../js/jquery-2.1.4.min.js"></script>
<script src="/static/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
function currentTime() {
let timeStamp = (new Date()).valueOf();

@ -274,7 +274,7 @@
</div>
</div>
<script src="../js/jquery-2.1.4.min.js"></script>
<script src="/static/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
appId = {{ .appId }};
@ -359,7 +359,7 @@
// 连接webSocket
ws = new WebSocket("ws://{{ .webSocketUrl }}/acc");
ws = new WebSocket("wss://{{ .webSocketUrl }}/acc");
ws.onopen = function(evt) {
console.log("Connection open ...");

Loading…
Cancel
Save