首先需要beego框架的环境,若未安装,或者版本太老不具有api功能,请先更新或安装此篇。
1.安装好beego环境
2.利用bee api创建
打开doc窗口,进入到项目src目录下。即root。
bee api基本语法
usage: bee api [appname]
create an api application base on beego framework
bee api [appname] [-tables=""] [-driver=mysql] [-conn=root:@tcp(127.0.0.1:3306)/
test]
-tables: a list of table names separated by ',', default is empty, indicating all tables
-driver: [mysql | postgres | sqlite], the default is mysql
-conn: the connection string used by the driver, the default is ''
e.g. for mysql: root:@tcp(127.0.0.1:3306)/test
e.g. for postgres: postgres://postgres:postgres@127.0.0.1:5432/postgres