This is a Mock Web Service for iTEC 2015
This API will be build using the Go programming language.
-
Install Go and set up your GOPATH
-
Install MongoDb
-
Create a database named apiGO_db and then create an user for the database using the following command in mongodb shell:
###
db.createUser( { user: "apiGOAdmin", pwd: "apiGOPass", roles: [ { role: "readWrite", db: "apiGO_db" } ] } )
- Install all the project dependencies by navigating to the project directory ($GOPATH/src/apiGO) and using the following command in the cmd/console/terminal:
###
go get -t ./...
- For testing purposes, create another database named apiGO_db_test, but don't create a user for it like for the main database. In order for the tests to run, you need to set the following environment variables correctly:
APIGO_TESTDB_NAME = apiGO_db_test
APIGO_TESTDB_CONN = mongodb://localhost:27017/apiGO_db_test
If you don't want to use the terminal for creating the databases, you can always use an useful app with GUI, such as Robomongo