Golang backend for online shop
Local setup:
Prerequisites:
- GOLang
- MySQL
Steps:
- Logging with your credentials using mysql cli.
mysql -u root -p
Enter password:
- Create a new database
create database online_shop;
use online_shop;
- Use initial sql file to create the tables and insert initial data
source sql/initialSetup/tableProducts.sql;
source sql/initialSetup/tableOrders.sql;
source sql/initialSetup/tableOrderedProducts.sql;
- Start main.go with those environment variables
MYSQL_USER =
MYSQL_PASSWORD =
MYSQL_IP_ADDRESS =
default: localhost:3306
Swagger
Go to
localhost:8080/swagger/index.html
to see the available endpoint and try example call.