-
Ensure that you have Golang installed:
go version
-
Ensure that you have psql installed:
<Windows key> + <type 'psql'>
-
Pull a copy of the source code using:
git clone [email protected]:nseah21/go-rest-api.git
viassh
,- or
git clone https://github.com/nseah21/go-rest-api.git
viahttps
, - or manually by downloding the ZIP file
-
In a terminal window, make sure you are inside the root directory
go-rest-api/
-
To test the server:
- Modify the
.env
file with your credentials forpsql
- Start up your
psql
shell using<Windows key> + <type 'psql'> + <Enter key>
and key in your credentials as in the previous step - Create a database by entering
CREATE DATABASE <database-name>;
- Change into your database by entering
\c <database-name>
- Copy and paste the definitions block from
./internal/db/init.sql
into yourpsql
shell - Optionally, you can also copy and paste the seed data block from
./internal/db/init.sql
into yourpsql
shell - In a terminal, verify that you are still in the root directory
go-rest-api/
- Run
go mod tidy
followed bygo run ./cmd/server
- Verify that the server is running on
localhost:8080
- Modify the
-
To run unit tests, run
go test -v ./...
in the root directorygo-rest-api/
-
Alternatively, you can run
go test ./...
for an overview of the test packages
-
Notifications
You must be signed in to change notification settings - Fork 0
nseah21/go-rest-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published