All Projects β†’ EvandroLG β†’ Pegasus.lua

EvandroLG / Pegasus.lua

Licence: mit
πŸš€ Pegasus.lua is an http server to work with web applications written in Lua language.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Pegasus.lua

Go Bootstrap
Easy way to bootstrap a web server in Go (Routing|Middleware|Https)
Stars: ✭ 27 (-90.15%)
Mutual labels:  server, http-server
Purescript Httpure
A web framework written in PureScript.
Stars: ✭ 112 (-59.12%)
Mutual labels:  server, http-server
Nodemcu Espress
Ultra-Lightweight and modular Node.js express like http server for NodeMCU. web - ESP8266
Stars: ✭ 39 (-85.77%)
Mutual labels:  server, http-server
Binserve
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. βš‘οΈπŸ¦€
Stars: ✭ 401 (+46.35%)
Mutual labels:  server, http-server
Coroute
Node HTTP reverse-proxy server
Stars: ✭ 147 (-46.35%)
Mutual labels:  server, http-server
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (+162.77%)
Mutual labels:  server, http-server
Http.swift
A tiny HTTP server engine written in swift.
Stars: ✭ 99 (-63.87%)
Mutual labels:  server, http-server
Fortjs
Component based MVC web framework for nodejs targeting good code structures & modularity.
Stars: ✭ 44 (-83.94%)
Mutual labels:  server, http-server
Pure Http
✨ The simple web framework for Node.js with zero dependencies.
Stars: ✭ 139 (-49.27%)
Mutual labels:  server, http-server
Watsonwebserver
Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
Stars: ✭ 125 (-54.38%)
Mutual labels:  server, http-server
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (+27.01%)
Mutual labels:  server, http-server
Rayo.js
Micro framework for Node.js
Stars: ✭ 170 (-37.96%)
Mutual labels:  server, http-server
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+1082.85%)
Mutual labels:  server, http-server
Jerrymouse
A scalable java servlet container base on reactor
Stars: ✭ 27 (-90.15%)
Mutual labels:  server, http-server
Http
Host These Things Please - a basic http server for hosting a folder fast and simply
Stars: ✭ 275 (+0.36%)
Mutual labels:  server, http-server
Hummingbird
Lightweight, flexible HTTP server framework written in Swift
Stars: ✭ 114 (-58.39%)
Mutual labels:  server, http-server
Falcon
A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
Stars: ✭ 2,058 (+651.09%)
Mutual labels:  server, http-server
Miniserve
🌟 For when you really just want to serve some files over HTTP right now!
Stars: ✭ 2,894 (+956.2%)
Mutual labels:  server, http-server
rony
Fast and Scalable RPC Framework
Stars: ✭ 41 (-85.04%)
Mutual labels:  http-server
Hosting
This is a setup for a Tor based shared web hosting server
Stars: ✭ 254 (-7.3%)
Mutual labels:  server

pegasus.lua

An http server to work with web applications written in Lua language check the site.

Build Status HuBoard badge Gitter

Installation

To install Pegasus.lua, run:

$ luarocks install pegasus

How does it work?

Follow an example:

local pegasus = require 'pegasus'

local server = pegasus:new({
  port='9090',
  location='example/root'
})

server:start(function (request, response)
  print "It's running..."
end)

Features

  • Compatible with Linux, Mac and Windows systems
  • Easy API
  • Support Lua >= 5.1
  • Native support for HTTP Streaming, aka chunked responses. Check how it works.
  • Native plugin to compress responses using the "gzip" method

API

Parameters

  • host:string Host address where the application will run. By default it uses localhost
  • port:string The port where the application will run. By default it's 9090
  • location:string Path used by Pegasus to search for the files. By default it's the root
  • plugins:table List with plugins
  • timeout:number It's a timeout for estabilishing a connection with the server

Request

Properties

  • path:string A string with the request path
  • headers:table A table with all the headers data
  • method:function The output is the request method as a string ('GET', 'POST', etc)
  • querystring:string It returns a dictionary with all the GET parameters
  • ip:string It returns the client's ip
  • port:number It returns the port where Pegasus is running

Response

Methods

  • addHeader(string:key, string:value) Adds a new header
  • addHeaders(table:headers) It adds news headers
  • statusCode(number:statusCode, string:statusMessage) It adds a Status Code
  • contentType(string:value) Adds a value to Content-Type field
  • write(string:body) It creates the body with the value passed as parameter
  • writeFile(string:file) It creates the body with the content of the file passed as parameter
  • post():table It returns a dictionary with all the POST parameters
local pegasus = require 'pegasus'

local server = pegasus:new({ port='9090' })

server:start(function (req, rep)
  rep:addHeader('Date', 'Mon, 15 Jun 2015 14:24:53 GMT'):write('hello pegasus world!')
end)

Native Plugin

  • pegasus.compress
local Pegasus = require 'pegasus'
local Compress = require 'pegasus.compress'

local server = Pegasus:new({
  plugins = { Compress:new() }
})

server:start()

Contributing

Install Dependencies

$ make install_dependencies

Running tests

$ make unit_test
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].