mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
07046ab978
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a |
||
---|---|---|
.. | ||
api/store | ||
env | ||
httputil | ||
store | ||
.env | ||
1_update_movie.png | ||
2_get_all_movies.png | ||
3_get_movie.png | ||
4_delete_movie.png | ||
0_create_movie.png | ||
main.go | ||
README.md |
Build RESTful API with the official MongoDB Go Driver and Iris
Article is coming soon, follow and stay tuned
Read the fully functional example.
$ go get -u go.mongodb.org/mongo-driver/...
$ go get -u github.com/joho/godotenv
# .env file contents
PORT=8080
DSN=mongodb://localhost:27017
$ go run main.go
> 2019/01/28 05:17:59 Loading environment variables from file: .env
> 2019/01/28 05:17:59 ◽ PORT=8080
> 2019/01/28 05:17:59 ◽ DSN=mongodb://localhost:27017
> Now listening on: http://localhost:8080
GET : http://localhost:8080/api/store/movies
POST : http://localhost:8080/api/store/movies
GET : http://localhost:8080/api/store/movies/{id}
PUT : http://localhost:8080/api/store/movies/{id}
DELETE : http://localhost:8080/api/store/movies/{id}