Skip to content

chenjsa/practicalGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

practicalGo

This is a golang practice project for go beginner.

This project is heavily inspired by the practialnode, but is wrote by go with Martini framework.

这是一个go网络编程的入门工程,网站内容参考practialnode,基于Martini框架进行开发。

Dependencies

Default Project requires Go, MongoDB and few other tools installed.

IntelliJ IDEA配置

为了能实时的使用gofmt自动格式化代码,需要对IDEA进行一些配置。

  1. 安装file watchers插件
  2. 添加模板 filewatchers
  3. 配置模板 gofmt
  4. 设置检测范围 scope

内容

  • lesson1分支:搭建最简单的HTTP服务器
    • Hello World!
  • lesson2分支:使用godep管理Martini依赖包,使用Martini框架搭建HTTP服务器
    • Hello World!
  • lesson3分支:使用React+Redux构建Web页面
    • 使用webpack构建
    • Redux
  • lesson4分支:使用antd组件库
    • 使用dva框架,二次封装Redux,更好的异步实现,更集中的代码。
    • 本地mock数据。
    • roadhog替代webpack。
    • 实现登录页。 login
  • todo
    • Rest API开发
    • 使用MongoDB进行数据存储
    • 上线部署

运行

Server编译

godep go build

Server开发模式运行

./practicalGo -war web

Web页面

cd web
yarn install
npm start

在浏览器地址栏输入http://localhost:8091查看页面

Let's go!