sap-tutorials / Issues

Creative Commons Attribution 4.0 International
6 stars 4 forks source link

Deploy a Go MSSQL API Endpoint in the Kyma Runtime #688

Closed Ngugisenior closed 2 years ago

Ngugisenior commented 2 years ago

Tutorials: https://developers.sap.com/tutorials/cp-kyma-api-mssql-golang.html

Hi,

I am trying to run my kyma go application locally by running this command

api-mssql-go ❯ go run ./cmd/api/main.go
2021/10/20 19:50:47 initilizing db configuration....
2021/10/20 19:50:47 Setting connection to db with configuration: ...

when i try to test the connection using curl the application automatically exits

api-mssql-go ❯ curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8000/orders
curl: (52) Empty reply from server
api-mssql-go ❯ go run ./cmd/api/main.go
2021/10/20 19:50:47 initilizing db configuration....
2021/10/20 19:50:47 Setting connection to db with configuration: ...;
2021/10/20 19:50:51 Could not ping db: Unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused
exit status 1
jcawley5 commented 2 years ago

Hello,

This will occur when the api can not access the database. Please check your connection parameters and verify that the database is running locally.

Regards, Jamie