Lambda-IoT Core

This repository contains a minimal Go REST service used as the backend for the Lambda-IoT project.

Repository: https://git.piskot.si/SeminarM2/lambdaiot-core

Features

  • Simple HTTP server with two endpoints:
    • GET /health — basic health check
    • GET /hello — example greeting endpoint
  • Tests for handlers using httptest
  • Multi-stage Dockerfile for small production images
  • Makefile with common tasks (build, run, test, docker-build)

Quickstart 🔧

Build and run locally:

make build
./bin/server

Run tests:

make test

Build Docker image:

make docker-build

Then run it:

docker run -p 8080:8080 lambdaiot-core:latest

Endpoints

  • http://localhost:8080/health — returns { "status": "ok" }
  • http://localhost:8080/hello — returns a small greeting JSON
  • POST http://localhost:8080/login — demo login, JSON body: { "username": "admin", "password": "password" }, returns { "token": "..." }
  • GET http://localhost:8080/protected — protected endpoint requiring Authorization: Bearer <token> header

Environment

  • JWT_SECRET — (optional) secret used to sign tokens; defaults to secret for local/dev use

If you want I can wire more features (structured logging, config, middleware, or dependency injection). Just tell me which direction to take. 🎯

Description
No description provided
Readme 7.9 MiB
Languages
Go 78%
Python 10.3%
C++ 9.5%
Shell 1.1%
Dockerfile 0.8%
Other 0.3%