Giter Site home page Giter Site logo

gf-demos's Introduction

GoFrame Demos

This repo implements some demos using GoFrame.

  1. A simple websocket chat service.
  2. Basic API example for user SignUp/SignIn.
  3. Universal CURD service.

Installation

1. You need a go development environment setup before everything starts taking off.

2. Use git clone cloing the repo to your local folder.

git clone https://github.com/gogf/gf-demos

3. Create configuration file from config.example.toml.

cp config/config.example.toml config/config.toml

Update config.toml according to your local configurations if necessary.

4. Run command go run main.go, and you'll see something as follows if success:

  SERVER  | DOMAIN  | ADDRESS | METHOD |        ROUTE        |                              HANDLER                              |           MIDDLEWARE             
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /chat               | github.com/gogf/gf-demos/app/api/chat.(*Controller).Index         | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /chat/index         | github.com/gogf/gf-demos/app/api/chat.(*Controller).Index         | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /chat/setname       | github.com/gogf/gf-demos/app/api/chat.(*Controller).SetName       | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /chat/websocket     | github.com/gogf/gf-demos/app/api/chat.(*Controller).WebSocket     | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /curd/:table/all    | github.com/gogf/gf-demos/app/api/curd.(*Controller).All           | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /curd/:table/delete | github.com/gogf/gf-demos/app/api/curd.(*Controller).Delete        | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /curd/:table/one    | github.com/gogf/gf-demos/app/api/curd.(*Controller).One           | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /curd/:table/save   | github.com/gogf/gf-demos/app/api/curd.(*Controller).Save          | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /curd/:table/update | github.com/gogf/gf-demos/app/api/curd.(*Controller).Update        | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/checknickname | github.com/gogf/gf-demos/app/api/user.(*Controller).CheckNickName | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/checkpassport | github.com/gogf/gf-demos/app/api/user.(*Controller).CheckPassport | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/issignedin    | github.com/gogf/gf-demos/app/api/user.(*Controller).IsSignedIn    | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/profile       | github.com/gogf/gf-demos/app/api/user.(*Controller).Profile       | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/profile       | github.com/gogf/gf-demos/app/api/user.(*Controller).Profile       | middleware.CORS,middleware.Auth  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/signin        | github.com/gogf/gf-demos/app/api/user.(*Controller).SignIn        | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/signout       | github.com/gogf/gf-demos/app/api/user.(*Controller).SignOut       | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|
  default | default | :8199   | ALL    | /user/signup        | github.com/gogf/gf-demos/app/api/user.(*Controller).SignUp        | middleware.CORS                  
|---------|---------|---------|--------|---------------------|-------------------------------------------------------------------|---------------------------------|

GoFrame Sites

GoFrame Repository

GoFrame Home

gf-demos's People

Contributors

gqcn avatar

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.