Creating a README file for your project is a great way to document its setup and usage. Here's a basic template you can use:
This is a simple blog API built with Go and Fiber framework, using MongoDB as the database.
-
Clone the repository:
git clone https://github.com/your-username/go-blog-api.git
-
Install dependencies:
go mod tidy
-
Set up environment variables:
Rename
.env.example
into.env
and put down the important credentials.# Database configuration MONGO_URI= MONGO_DATABASE_NAME= # Server configuration SERVER_PORT= # JWT configuration JWT_SECRET=
-
Start the MongoDB server:
Make sure MongoDB is running on your machine or update the
MONGO_URI
in the.env
file with the MongoDB connection string. -
Run the application:
go run main.go