This project is a backend for a blog application written in GoLang.
191
This project is a backend for a blog application written in GoLang. It provides a complete CRUD (Create, Read, Update, Delete) functionality for managing blog posts. The project uses GORM for ORM and SQLite as the database.
/blog
/main.go
/routes
/routes.go
/models
/post.go
/comment.go
/user.go
/controllers
/post_controller.go
/comment_controller.go
/user_controller.go
/config
/database.go
/middleware
/auth.go
.env file with the necessary environment variables (e.g., PORT).Installing Clone the repository:
git clone https://github.com/aleksanderpalamar/blog-backend.git
cd blog-backend
Install dependencies:
go mod download
or
go mod tidy
go run main.go
The server will start at http://localhost:8080 (or the port specified in your .env file).
This project includes a Dockerfile and docker-compose.yml file to help you manage common task more easily. Here's a list of the available commands and a brief description of what they do:
docker compose up --build: Builds the Docker image and starts the containers.docker compose down: Stops and removes the containers./posts: Retrieve all blog posts./posts/:i: Retrieve a single blog post by ID./posts: Create a new blog post./posts/:id: Update an existing blog post by ID./posts/:id: Delete a blog post by IDThis project is licensed under the MIT License file for details.
Content type
Image
Digest
sha256:58e64b812…
Size
224.8 MB
Last updated
over 2 years ago
docker pull palamardev/blog-backend