Skip to content

RIDOS/echo-hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Echo-hello

Go

This project showcases a service built using the Echo framework and utilizes ZeroLog for logging.

How It Works

Project use port :8080 and use endpoint:

curl http://localhost:8080/status

This endpoint output count of days until the start of the year 2025.

Also, we can use endpoint with header like this:

curl -H "User-Role: Admin" http://localhost:8080/status

And then we can see in server console output:

⇨ http server started on [::]:8080
5:47AM WRN red button user detected

This warning indicates that a user with the "admin" role accessed the endpoint.

Getting Started

Running the Application Locally

Clone this repo:

git clone https://github.com/RIDOS/echo-hello

Install dependencies:

go mod download

Build app:

go build echo-hello

Run:

./echo-hello

Running the Application with Docker

Build your image:

docker build -t echo-hello .

Start container:

docker run -p 8080:8080 echo-hello

Links

I would like spatecon for their instructional video and guidance, which greatly contributed to the development of this application.

About

Simple service in Encho and Zerolog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published