{"id":13817314,"url":"https://github.com/chinanf-boy/vue-with-go-example","last_synced_at":"2026-04-29T16:04:52.223Z","repository":{"id":90548733,"uuid":"131379112","full_name":"chinanf-boy/vue-with-go-example","owner":"chinanf-boy","description":"go 与 vue 合并服务","archived":false,"fork":false,"pushed_at":"2018-05-24T04:05:53.000Z","size":198,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T08:47:11.970Z","etag":null,"topics":["example","go","vue"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinanf-boy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-28T06:15:39.000Z","updated_at":"2018-05-24T04:05:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"eaaf8387-7e3a-45b8-a468-df3d4dda4142","html_url":"https://github.com/chinanf-boy/vue-with-go-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fvue-with-go-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fvue-with-go-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fvue-with-go-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fvue-with-go-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/vue-with-go-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866100,"owners_count":20846496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","go","vue"],"created_at":"2024-08-04T06:00:39.906Z","updated_at":"2026-04-29T16:04:47.181Z","avatar_url":"https://github.com/chinanf-boy.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# vue-with-go\n\n「 `go`的server服务, `vue`的前端 」\n\n[![explain](http://llever.com/explain.svg)](https://github.com/chinanf-boy/Source-Explain)\n\n---\n\n## go后端与vue前端例子\n\n### use-使用\n\n- 1. `git clone `\n\n```\ngo run main.go serve\n```\n\n- 2. `go get`\n\n```\ngo get -u -v github.com/chinanf-boy/vue-with-go-example \n```\n\n``` bash\nvue-with-go-example good-serve\n//or\nvue-with-go-example bad-serve\n```\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ch3\u003e有关 good 和 bad serve 有什么区别\u003c/h3\u003e\u003c/summary\u003e\n\n```\ngo get -u -v github.com/chinanf-boy/vue-with-go-example \n```\n\n一般来说 `go get`之后使用 `serve` 是不行的\n\n\u003e为什么呢❓\n\n我们其实是通过 运行 一个完整的二进制程序 `GOPATH/bin/vue-with-go-example` =\u003e `二进制`\n\n当开启服务器, 请求 `clinet/index.html` 怎么会有呢. 不存在的嘛, 这就造成了, 你只能在对应项目下运行\n\n``` bash\nvue-with-go-example bad-serve \n```\n\n---\n\n但是, 当然, 有解决办法, 就是把 前端所有的文件 进行 `二进制 `转化处理 _main.go_ [//go:generate fileb0x filebox.json\n](https://github.com/UnnoTed/fileb0x)\n\n``` bash\nvue-with-go-example good-serve\n```\n\n---\n\nfilebox.json\n\n``` json\n{\n    \"pkg\": \"assets\",\n    \"dest\": \"./assets/\",\n    \"fmt\": true,\n    \"compression\": {\n        \"compress\": true,\n        \"method\": \"\"\n    },\n    \"output\": \"assets.go\", // 通过 assets.ReadFile(path) 意义上路径, 复制 缓存好的 html,js 二进制 给 服务器\n    \"custom\": [{\n        \"files\": [\"./client/\"],\n        \"base\": \"client/\",\n        \"exclude\": [\n            \"less/*.less\"\n        ]\n    }]\n}\n```\n\n\u003c/details\u003e\n  \n---\n\n例子主要来自 [书签🔖管理-go](https://github.com/RadhiFadlillah/shiori)\n\n\u003e 不可否认, 开启 `shiori serve` 后 对书签🔖的更改, 是如此的容易程序崩溃, 但同时, 也让我们看到 go 与 vue 的结合\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fvue-with-go-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fvue-with-go-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fvue-with-go-example/lists"}