ABOUT This is a very basic REST API implementation with Golang. It's bee over a year since wrote Golang code thus I really enjoyed working on this project.
- Getting Started ..prerequisites ..Installation
- Technology Stack
- Built With
- Useful Links
- Improvements
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To get started with this project you need a basic knowledge of :
Golang
Version Control (Git)
The following instructions will install the project on your local machine
- Clone the repository here
- [cd] into the root directory of the project folder
pascal-ulor-coding-challenge
. - Run
go mod tidy
on the terminal to install Dependencies/Modules
- use the
.env.example
file to create your environment variables. - Now open terminal to build then run the application
go build -o bin/main
./bin/main
If all goes well, you should see something similar to this on the console:
Application started on http://localhost:<port>
To test the endpoints, create a test database and run the following:
go test
- GO - Golang
The API is built for easy use and understanding. It includes the following:
- The GET endpoint to get the details of a block.
- The GET TO GET details of a transaction.
EndPoint | Functionality |
---|---|
POST /block/:network/:ref |
Gets details of a block in a blockchain |
POST /trx/:network/:ref |
Gets details of a transaction in a block using specified transaction reference |
Now you can test the endpoints with a client e.g POSTMAN
- Use go channels to improve application runtime.
- Improve test coverage
- Ulor Pascal - PascalUlor