okapi-example

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 2 Imported by: 0

README

Okapi Example

A simple example demonstrating the Okapi API Framework

Okapi is a modern, minimalist HTTP web framework for Go, inspired by FastAPI's elegance. Designed for simplicity, performance, and developer happiness, it helps you build fast, scalable, and well-documented APIs with minimal boilerplate.

Prerequisites

  • Go installed
  • Git installed

Features

  • Basic Okapi implementation example
  • Okapi middlewares
  • Okapi Route Definition
  • Ready-to-run code structure

Getting Started

Clone the Repository
git clone https://github.com/jkaninda/okapi-example
cd okapi-example
Install Dependencies
go mod tidy
Run the Application
go run .
Using Docker
docker run --rm --name okapi-example -p 8080:8080 jkaninda/okapi-example

Use JWT_SIGNING_SECRET environment variable if you want to change JWT secret, default: supersecret

Visit http://localhost:8080 to see the response:

{"message": "Welcome to the Okapi Web Framework!"}

Visit http://localhost:8080/docs/ to see the documentation

Project Structure

.
├── main.go          # Main application file
├── middlewares      # Middlewares package
├── controllers      # Controllers package
├── routes           # Routes package
├── models           # Models package
└── README.md        # Project documentation
Swagger UI Preview

Okapi automatically generates Swagger UI for all routes:

Okapi Swagger Interface


License

MIT - Feel free to use and modify this example.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL