Skip to content

Latest commit

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

HTTP server in different languages

Problem statement

The server listens on localhost:8000 and exposes /version endpoint.

The /version endpoint returns a RESTful JSON response with the "version" fields. The payload should be serialized to JSON from a struct or class, not printed as a simple string.

Other routes, root included, should return 404.

When the server runs, it should respond to curl http://localhost:8000/version or in the web browser.

Used compilers and interpreters

languageversionframworksourcerun command
zig0.14.0httpzmain.zigmake zig
rustc1.82.0warpmain.rsmake rust
swift6.0vapormain.swiftmake swift
go1.23-main.gomake go
v0.4.8-main.vmake v
crystal1.14.0-main.crmake crystal
assemberarm64macos/libcmain.smake arm64
d/ldc1.40vibemain.dmake d
ruby3.3.6sinatramain.rbmake ruby
dart3.5.4-main.dartmake dart
deno2.0.6-main-deno.tsmake deno
bun1.1.34-main-bun.tsmake bun
node23.1.0-main.jsmake node
php8.3.13-main.phpmake php
python3.13fastapimain.pymake python
pascal/fpc3.2.2-main.pasmake fpc
lua5.4.7copasmain.luamake lua
c#/dotnet9.0.0-main.csmake cs
f#/dotnet9.0.0suavemain.fsmake fs
perl5.34.1mojoliciousmain.plmake perl
nim2.2.0httpbeastmain.nimmake nim
julia1.11.2HTTPmain.jlmake julia

All implementations above are tested on macOS 15.1 Sequoia.

Run client

make q or curl -q http://localhost:8000/version.

Contributions

C# version is rewritten by @neon-sunset

Swift version is rewritten by @Frizlab

arm64 assembly version is based on @dmtrKovalenko's macos-assembly-http-server

About

A simple HTTP REST API server in different languages

Resources

Stars

37 stars

Watchers

1 watching

Forks

Contributors

Languages