iris/_examples/tutorial/mongodb
2020-03-05 22:41:27 +02:00
..
api/store obey the vote of @1370 (77-111 at this point) - add import suffix on iris repository 2019-10-25 01:27:02 +03:00
env add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
httputil obey the vote of @1370 (77-111 at this point) - add import suffix on iris repository 2019-10-25 01:27:02 +03:00
store create the new FileServer and HandleDir, deprecate the rest APIBuilder/Party static methods and more 2019-06-21 19:43:25 +03:00
.env add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
1_update_movie.png add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
2_get_all_movies.png add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
3_get_movie.png add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
4_delete_movie.png add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
0_create_movie.png add tutorial for the official mongodb go driver 2019-01-28 05:36:44 +02:00
main.go examples: replace all app.Run(iris.Addr(...)) with app.Listen just for the shake of simplicity, both are doing the same exact thing as it's described on the http listening first example. 2020-03-05 22:41:27 +02:00
README.md create the new FileServer and HandleDir, deprecate the rest APIBuilder/Party static methods and more 2019-06-21 19:43:25 +03:00

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}

Screens

Add a Movie

Update a Movie

Get all Movies

Get a Movie by its ID

Delete a Movie by its ID