niagadsofinquery
=======
##There are RESTful API & Authenticaiton for the simple Phenotypes/Genotypes query.
** This project is done using Gin Framework+ MongoDB + JWT(JSON Web Token) + Golang. **
Configuration
Pre-requisites: Go1.6, MongoDBv3.2.1, Ginv1.0
mongod --dbpath ~/PATH/DB
mongo
> use admin
switched to db admin
> db.createUser(
... {
... user: "name",
... pwd: "password",
... roles: [ { role: "readWrite", db: "test" } ]
... }
... )
mongod --auth --dbpath ~/PATH/DB
go get && go install && PORT=7000 DEBUG=* gin -p 9000 -a 7000 -i run
###Request
URL | Method | Parameters | Description |
---|---|---|---|
/admin/secrets | GET | name,password | Admin Login |
/api/oauth2/token | GET | Token Info | |
/api/phenotypes | GET | Fetching All phenotypes | |
/api/phenotypes | POST | title, sex, birth, ageonset, famliyID, individualID, paternalID, maternalID | To Create a New phenotype |
/api/phenotypes/:id | GET | Fetching A Single phenotypes | |
/api/phenotypes/:id | PUT | title, sex, birth, ageonset, famliyID, individualID, paternalID, maternalID | Updating a Single phenotype |
/api/phenotypes/:id | DELETE | id | Delete a Single phenotype |
/api/genotypes | GET | Fetching All genotypes | |
/api/genotypes | POST | title, variantID, location, call | To Create a New genotype |
/api/genotypes/:id | GET | Fetching A Single genotype | |
/api/genotypes/:id | PUT | title, variantID, location, call | Updating a Single genotype |
/api/genotypes/:id | DELETE | id | Delete a Single genotype |