Hyperspace-Logistics / heart

Licence: MPL-2.0 license
A high performance Lua web server with a simple, powerful API

Programming Languages

go
31211 projects - #10 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to heart

Ocamlapi
Path-based http request routing in Ocaml.
Stars: ✭ 19 (-75.64%)
Mutual labels:  http-server
tipi
Tipi - the All-in-one Web Server for Ruby Apps
Stars: ✭ 214 (+174.36%)
Mutual labels:  http-server
matador
Take your appclication by the horns
Stars: ✭ 59 (-24.36%)
Mutual labels:  http-server
devheart
Listen to Tux's heartbeat with this awesome Linux Kernel Module ❤️
Stars: ✭ 58 (-25.64%)
Mutual labels:  heart
gofile
HTTP/1.1 directory listing and file server using TCP sockets for fun
Stars: ✭ 59 (-24.36%)
Mutual labels:  http-server
go-sse
Fully featured, spec-compliant HTML5 server-sent events library
Stars: ✭ 165 (+111.54%)
Mutual labels:  http-server
Crow
A Fast and Easy to use microframework for the web.
Stars: ✭ 1,718 (+2102.56%)
Mutual labels:  http-server
wine
A lightweight and flexible framework to help build elegant web API
Stars: ✭ 39 (-50%)
Mutual labels:  http-server
open-rest-es6-boilerplate
open-rest boilerplate project with es6
Stars: ✭ 24 (-69.23%)
Mutual labels:  http-server
cpp-rest-api
RESTFul Web service by C++, implemented basic REST endpoints and RESTVerbs (GET,POST,PUT,DELETE).
Stars: ✭ 13 (-83.33%)
Mutual labels:  http-server
Kvantum
An intellectual (HTTP/HTTPS) web server with support for server side templating (Crush, Apache Velocity and JTwig)
Stars: ✭ 17 (-78.21%)
Mutual labels:  http-server
waycup
A minimal tool that hides your online assets from online security scanners, researchers and hackers.
Stars: ✭ 100 (+28.21%)
Mutual labels:  http-server
http-server
A Java HTTP server in 35MB Docker image
Stars: ✭ 17 (-78.21%)
Mutual labels:  http-server
httpfs
Go 编写的静态文件服务器,支持文件拖拽上传,无第三方包依赖, 支持 Windows, Linux , Darwin。
Stars: ✭ 28 (-64.1%)
Mutual labels:  http-server
edap
No description or website provided.
Stars: ✭ 22 (-71.79%)
Mutual labels:  http-server
ValaSimpleHTTPServer
Simple HTTP server made in vala
Stars: ✭ 49 (-37.18%)
Mutual labels:  http-server
pycameresp
Motion detection with image notification for Esp32CAM and Esp32 flasher with GUI based on esptool.py.
Stars: ✭ 40 (-48.72%)
Mutual labels:  http-server
HttpServerLite
TCP-based simple HTTP and HTTPS server, written in C#.
Stars: ✭ 44 (-43.59%)
Mutual labels:  http-server
wordvector be
Web服务:使用腾讯 800 万词向量模型和 spotify annoy 引擎得到相似关键词
Stars: ✭ 92 (+17.95%)
Mutual labels:  http-server
rust-spa-auth
Example application using a Vue frontend with Rust backend that has authentication + authorization.
Stars: ✭ 45 (-42.31%)
Mutual labels:  http-server

Heart 💜

A high performance Lua web server with a simple, powerful API. See the full documentation here.

Check out redbean!

If you like Heart then you'll probably love redbean. It's a very similar concept but arguably executed and documented better.

Overview

Heart combines Go's fasthttp with LuaJIT to create an insanely fast Lua web server.

It also comes with a performant key-value store API backed by BadgerDB that can store data both in memory and on disk.

Features

  • High throughput
  • Low latency
  • Fast K/V store
  • Versioned API
  • Stable Lua 5.1 VM
  • Structured logs

Getting Started

  • Create a Lua file that uses the Heart API
-- main.lua
local app = require('heart.v1')

app.get('/:name', function(ctx)
  return 'Hello, ' .. ctx.pathParam('name') .. '!'
end)
  • Run Heart with Docker and point it at your Lua docker run -v $(pwd):/root/app -p 3333:3333 hyperspacelogistics/heart:latest app/main.lua
  • curl localhost:3333/world to see the result
  • Congratulations you're running a wicked fast Lua server 🎊

Benchmark

Benchmark

Each stack was tasked with rendering {"hello": "world"} through their JSON stack in production mode, if applicable, with logging disabled. wrk was used with the command wrk -t32 -c512 -d30s http://localhost:3333. All benchmarks were performed on a CPU-optimized DigitalOcean droplet that had 32vCPUs and 64 GB of RAM.

Caveats

Global state, like with any parallel web server, is highly discouraged. For performance reasons Heart keeps a pool of Lua state to reuse in subsequent requests. State is reused in a random order and therefore global state that is modified in requests is functionally random in Heart. Be cautious! Static global state is the exception and can generally be treated as safe.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].