Git Product home page Git Product logo

golang-gin-vue's Introduction

vue-test

相关过程讲解使用golang的gin框架和vue编写web应用

Build Setup

# install dependencies
cnpm install

# serve with hot reload at localhost:8080
cnpm run dev

# build for production with minification
cnpm run build

# build for production and view the bundle analyzer report
cnpm run build --report

# run unit tests
cnpm run unit

# run e2e tests
cnpm run e2e

# run all tests
cnpm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

Run the golang-gin-vue

# 安装异步请求包
$ cnpm install --save axios
# 需要注意的是,如果跨域请求需要接口处增加请求的Header

# 运行前端代码
$ cd vue-test
$ cnpm run dev

# 运行后端接口服务
$ go run main.go
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /v1/hello                 --> main.HelloPage (3 handlers)
[GIN-debug] GET    /v1/hello/:name           --> main.main.func1 (3 handlers)
[GIN-debug] GET    /v1/line                  --> main.main.func2 (3 handlers)


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.