ProductPromotion
Lua
made by https://0x3d.site
GitHub - EvandroLG/pegasus.lua: :rocket: Pegasus.lua is an http server to work with web applications written in Lua language.:rocket: Pegasus.lua is an http server to work with web applications written in Lua language. - EvandroLG/pegasus.lua
Visit Site
GitHub - EvandroLG/pegasus.lua: :rocket: Pegasus.lua is an http server to work with web applications written in Lua language.
An http server to work with web applications written in Lua language check the site.
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)
Or try the included examples.
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 useslocalhost
port:string
The port where the application will run. By default it's9090
location:string
Path used by Pegasus to search for the files. By default it's the rootplugins:table
List with pluginstimeout:number
It's a timeout for estabilishing a connection with the server
Request
Properties
path:string
A string with the request pathheaders:table
A table with all the headers datamethod:function
The output is the request method as a string ('GET', 'POST', etc)querystring:string
It returns a dictionary with all the GET parametersip:string
It returns the client's ipport:number
It returns the port where Pegasus is running
Response
Methods
addHeader(string:key, string:value)
Adds a new headeraddHeaders(table:headers)
It adds news headersstatusCode(number:statusCode, string:statusMessage)
It adds a Status CodecontentType(string:value)
Adds a value to Content-Type fieldwrite(string:body)
It creates the body with the value passed as parameterwriteDefaultErrorMessage(statusCode: string, message:body)
It sets an HTTP status code and writes an error message to the responsewriteFile(string:file)
It creates the body with the content of the file passed as parameterpost():table
It returns a dictionary with all the POST parametersredirect(location:string, temporary:boolean):
Makes an HTTP redirect to a new location. The status code is set to 302 if temporary is true and false otherwise.
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!')
return rep:close()
end)
Native Plugin
- pegasus.plugins.compress
local Pegasus = require 'pegasus'
local Compress = require 'pegasus.plugins.compress'
local server = Pegasus:new({
plugins = { Compress:new() }
})
server:start()
- pegasus.plugins.downloads
local Pegasus = require 'pegasus'
local Downloads = require 'pegasus.plugins.downloads'
local server = Pegasus:new({
plugins = {
Downloads:new {
prefix = "downloads",
stripPrefix = true,
},
}
})
server:start()
- pegasus.plugins.files
local Pegasus = require 'pegasus'
local Files = require 'pegasus.plugins.files'
local server = Pegasus:new({
plugins = {
Files:new {
location = "./",
default = "index.html",
},
}
})
server:start()
- pegasus.plugins.tls
local Pegasus = require 'pegasus'
local Tls = require 'pegasus.plugins.tls'
local server = Pegasus:new({
plugins = {
TLS:new {
wrap = {
mode = "server",
protocol = "any",
key = "./serverAkey.pem",
certificate = "./serverA.pem",
cafile = "./rootA.pem",
verify = {"none"},
options = {"all", "no_sslv2", "no_sslv3", "no_tlsv1"},
},
sni = nil,
},,
}
})
server:start()
Contributing
Install Dependencies
$ make install_dependencies
Running tests
$ make unit_test
More Resourcesto explore the angular.
mail [email protected] to add your project or resources here 🔥.
- 1Torch | Scientific computing for LuaJIT.
http://torch.ch/
Torch is a scientific computing framework for LuaJIT.
- 2OpenResty
https://github.com/openresty
A Fast and Scalable Web Platform by Extending NGINX with LuaJIT. Commercial support is provided at https://openresty.com/ - OpenResty
- 3Build software better, together
https://github.com/fperrad/lua-MessagePack
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
- 4Concurrency oriented programming in Lua
https://github.com/lefcha/concurrentlua
Concurrency oriented programming in Lua. Contribute to lefcha/concurrentlua development by creating an account on GitHub.
- 5LPeg version 1.0 Parser in pure LuaJIT
https://github.com/sacek/LPegLJ
LPeg version 1.0 Parser in pure LuaJIT. Contribute to sacek/LPegLJ development by creating an account on GitHub.
- 6New maintainer at: https://github.com/lunarmodules/lualogging
https://github.com/Neopallium/lualogging
New maintainer at: https://github.com/lunarmodules/lualogging - Neopallium/lualogging
- 7Archives of the Kepler Project
https://github.com/keplerproject
Public Archives of various modules created by the Kepler Project from 2003 to 2009. For up-to-date Lua modules, check out LuaRocks and the Lunar Modules project - Archives of the Kepler Project
- 8JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible.
https://github.com/harningt/luajson
JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible. - harningt/luajson
- 9A lightweight, dependency-free library for binding Lua to C++
https://github.com/vinniefalco/LuaBridge
A lightweight, dependency-free library for binding Lua to C++ - vinniefalco/LuaBridge
- 10Free Cross-Platform 2D Game Engine
https://coronalabs.com/
Corona is a 2D engine lets you build games & apps for all major platforms including iOS, Android, Kindle, Apple TV, Android TV, macOS, and Windows. Get the free toolset!
- 11A copy of the Lua development repository, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests or any other stuff. All communication should be through the Lua mailing list https://www.lua.org/lua-l.html
https://github.com/lua/lua
A copy of the Lua development repository, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests or any other stuff. All communication should be through the Lua mailing lis...
- 12A lightweight JSON library for Lua
https://github.com/rxi/json.lua
A lightweight JSON library for Lua. Contribute to rxi/json.lua development by creating an account on GitHub.
- 13A Lua-based Build Tool
https://github.com/stevedonovan/Lake
A Lua-based Build Tool. Contribute to stevedonovan/Lake development by creating an account on GitHub.
- 14Feature-rich command line parser for Lua
https://github.com/mpeterv/argparse
Feature-rich command line parser for Lua. Contribute to mpeterv/argparse development by creating an account on GitHub.
- 15Lua code analysis, with plugins for HTML and SciTE
https://github.com/davidm/lua-inspect
Lua code analysis, with plugins for HTML and SciTE - davidm/lua-inspect
- 16Auto-swaps changed Lua files in a running LÖVE project
https://github.com/rxi/lurker
Auto-swaps changed Lua files in a running LÖVE project - rxi/lurker
- 17Remote debugger for Lua.
https://github.com/pkulchenko/MobDebug
Remote debugger for Lua. Contribute to pkulchenko/MobDebug development by creating an account on GitHub.
- 18Asynchronous logging library for Lua
https://github.com/moteus/lua-log
Asynchronous logging library for Lua. Contribute to moteus/lua-log development by creating an account on GitHub.
- 19luaproc is a concurrent programming library for Lua
https://github.com/askyrme/luaproc
luaproc is a concurrent programming library for Lua - askyrme/luaproc
- 20A redis client for lua
https://github.com/daurnimator/lredis
A redis client for lua. Contribute to daurnimator/lredis development by creating an account on GitHub.
- 21Lua Users Foundation
https://github.com/lua-users-foundation
Lua Users Foundation has 2 repositories available. Follow their code on GitHub.
- 22Date & Time module for Lua 5.x
https://github.com/Tieske/date
Date & Time module for Lua 5.x. Contribute to Tieske/date development by creating an account on GitHub.
- 23:rocket: Pegasus.lua is an http server to work with web applications written in Lua language.
https://github.com/EvandroLG/pegasus.lua
:rocket: Pegasus.lua is an http server to work with web applications written in Lua language. - EvandroLG/pegasus.lua
- 24A self contained Lua MessagePack C implementation.
https://github.com/antirez/lua-cmsgpack
A self contained Lua MessagePack C implementation. - antirez/lua-cmsgpack
- 25Automatically exported from code.google.com/p/llvm-lua
https://github.com/neopallium/llvm-lua
Automatically exported from code.google.com/p/llvm-lua - Neopallium/llvm-lua
- 26Fork of LuaCrypto, which enables encryption and decryption through OpenSSL
https://github.com/mkottman/luacrypto
Fork of LuaCrypto, which enables encryption and decryption through OpenSSL - mkottman/luacrypto
- 27A pure c# implementation of Lua 5.2 focus on compatibility with Unity
https://github.com/xebecnan/UniLua
A pure c# implementation of Lua 5.2 focus on compatibility with Unity - xebecnan/UniLua
- 28Digital Estate Planning: The Game
https://github.com/hawkthorne/hawkthorne-journey
Digital Estate Planning: The Game. Contribute to hawkthorne/hawkthorne-journey development by creating an account on GitHub.
- 29Lua CJSON is a fast JSON encoding/parsing module for Lua
https://github.com/mpx/lua-cjson/
Lua CJSON is a fast JSON encoding/parsing module for Lua - mpx/lua-cjson
- 30Go bindings for Lua C API - in progress
https://github.com/aarzilli/golua
Go bindings for Lua C API - in progress. Contribute to aarzilli/golua development by creating an account on GitHub.
- 31Lua binding to libzip.
https://github.com/brimworks/lua-zip
Lua binding to libzip. Contribute to brimworks/lua-zip development by creating an account on GitHub.
- 32SAX-like streaming XML parser for Lua
https://github.com/Phrogz/SLAXML
SAX-like streaming XML parser for Lua. Contribute to Phrogz/SLAXML development by creating an account on GitHub.
- 33Lanes is a lightweight, native, lazy evaluating multithreading library for Lua 5.1 to 5.4.
https://github.com/LuaLanes/lanes
Lanes is a lightweight, native, lazy evaluating multithreading library for Lua 5.1 to 5.4. - LuaLanes/lanes
- 34Utility library for functional programming in Lua
https://github.com/Yonaba/Moses
Utility library for functional programming in Lua - Yonaba/Moses
- 35Lua Fun is a high-performance functional programming library for Lua designed with LuaJIT's trace compiler in mind.
https://github.com/luafun/luafun
Lua Fun is a high-performance functional programming library for Lua designed with LuaJIT's trace compiler in mind. - luafun/luafun
- 36Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.
https://github.com/jmckaskill/luaffi
Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface. - jmckaskill/luaffi
- 37StackTracePlus provides enhanced stack traces for Lua.
https://github.com/ignacio/StackTracePlus
StackTracePlus provides enhanced stack traces for Lua. - ignacio/StackTracePlus
- 38A lua-based Pac-Man clone.
https://github.com/tylerneylon/pacpac
A lua-based Pac-Man clone. Contribute to tylerneylon/pacpac development by creating an account on GitHub.
- 39ANSI terminal color manipulation for Lua.
https://github.com/kikito/ansicolors.lua
ANSI terminal color manipulation for Lua. Contribute to kikito/ansicolors.lua development by creating an account on GitHub.
- 40Embedded Lua templates
https://github.com/leafo/etlua
Embedded Lua templates. Contribute to leafo/etlua development by creating an account on GitHub.
- 41Reactive Extensions for Lua
https://github.com/bjornbytes/RxLua
Reactive Extensions for Lua. Contribute to bjornbytes/RxLua development by creating an account on GitHub.
- 42File system path manipulation library
https://github.com/moteus/lua-path
File system path manipulation library. Contribute to moteus/lua-path development by creating an account on GitHub.
- 43Lua binding to ZeroMQ
https://github.com/zeromq/lzmq
Lua binding to ZeroMQ. Contribute to zeromq/lzmq development by creating an account on GitHub.
- 44Lua bindings for POSIX APIs
https://github.com/luaposix/luaposix
Lua bindings for POSIX APIs. Contribute to luaposix/luaposix development by creating an account on GitHub.
- 45Lightweight Lua test framework
https://github.com/bjornbytes/lust
Lightweight Lua test framework. Contribute to bjornbytes/lust development by creating an account on GitHub.
- 46A tool for linting and static analysis of Lua code.
https://github.com/mpeterv/luacheck
A tool for linting and static analysis of Lua code. - GitHub - mpeterv/luacheck: A tool for linting and static analysis of Lua code.
- 47A fast, lightweight tweening library for Lua
https://github.com/rxi/flux
A fast, lightweight tweening library for Lua. Contribute to rxi/flux development by creating an account on GitHub.
- 48Fast, lightweight and easy-to-use pathfinding library for grid-based games
https://github.com/Yonaba/Jumper
Fast, lightweight and easy-to-use pathfinding library for grid-based games - Yonaba/Jumper
- 49Opinionated Lua RabbitMQ client library for the ngx_lua apps based on the cosocket API
https://github.com/wingify/lua-resty-rabbitmqstomp
Opinionated Lua RabbitMQ client library for the ngx_lua apps based on the cosocket API - wingify/lua-resty-rabbitmqstomp
- 50Build a standalone executable from a Lua program.
https://github.com/ers35/luastatic
Build a standalone executable from a Lua program. Contribute to ers35/luastatic development by creating an account on GitHub.
- 51Human-readable representation of Lua tables
https://github.com/kikito/inspect.lua
Human-readable representation of Lua tables. Contribute to kikito/inspect.lua development by creating an account on GitHub.
- 52Lexing & Syntax Highlighting in Lua (using LPeg)
https://github.com/xolox/lua-lxsh
Lexing & Syntax Highlighting in Lua (using LPeg). Contribute to xolox/lua-lxsh development by creating an account on GitHub.
- 53Pure Lua Cassandra client using CQL binary protocol
https://github.com/jbochi/lua-resty-cassandra
Pure Lua Cassandra client using CQL binary protocol - jbochi/lua-resty-cassandra
- 5430 lines library for object orientation in Lua
https://github.com/Yonaba/30log
30 lines library for object orientation in Lua. Contribute to Yonaba/30log development by creating an account on GitHub.
- 55LibYAML binding for Lua.
https://github.com/gvvaughan/lyaml
LibYAML binding for Lua. Contribute to gvvaughan/lyaml development by creating an account on GitHub.
- 56A very complete i18n lib for Lua
https://github.com/kikito/i18n.lua
A very complete i18n lib for Lua. Contribute to kikito/i18n.lua development by creating an account on GitHub.
- 57A Lua 5.3 parser written with LPegLabel
https://github.com/andremm/lua-parser
A Lua 5.3 parser written with LPegLabel. Contribute to andremm/lua-parser development by creating an account on GitHub.
- 58A Lua MVC Web Framework.
https://github.com/sailorproject/sailor
A Lua MVC Web Framework. Contribute to sailorproject/sailor development by creating an account on GitHub.
- 59Intellisense and Linting for Lua in VSCode
https://github.com/trixnz/vscode-lua
Intellisense and Linting for Lua in VSCode. Contribute to trixnz/vscode-lua development by creating an account on GitHub.
- 60Lua binding to libcurl
https://github.com/Lua-cURL/Lua-cURLv3
Lua binding to libcurl. Contribute to Lua-cURL/Lua-cURLv3 development by creating an account on GitHub.
- 61Time, Date and Timezone library for lua
https://github.com/daurnimator/luatz
Time, Date and Timezone library for lua. Contribute to daurnimator/luatz development by creating an account on GitHub.
- 62Lua library for conversion between markup formats
https://github.com/jgm/lunamark
Lua library for conversion between markup formats. Contribute to jgm/lunamark development by creating an account on GitHub.
- 63Nginx image processing server with OpenResty and Lua
http://leafo.net/posts/creating_an_image_server.html
Today I'll be showing you how to create a fast on the fly image processing server. The whole system can be created in less than 100 lines of code. We'll be using OpenResty , an enhanced distribution of Nginx. We'll also need to write a...
- 64ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
https://gist.github.com/perky/2838755
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns. - ProFi.lua
- 65Batteries included Lua
https://github.com/tongson/omnia
Batteries included Lua. Contribute to tongson/omnia development by creating an account on GitHub.
- 66An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
https://github.com/koreader/koreader
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices - koreader/koreader
- 67Tweening/Easing/Interpolating functions for lua. Inspired on jQuery's animate method.
https://github.com/kikito/tween.lua
Tweening/Easing/Interpolating functions for lua. Inspired on jQuery's animate method. - kikito/tween.lua
- 68Lua redis client driver for the ngx_lua based on the cosocket API
https://github.com/openresty/lua-resty-redis
Lua redis client driver for the ngx_lua based on the cosocket API - openresty/lua-resty-redis
- 69Technews.fr - High Tech, Tests, et Tutos
http://www.luteus.biz/Download/LoriotPro_Doc/LUA/LUA_For_Windows/lanes/comparison.html
Technews.fr est un blog High Tech avec des tests, des avis ou encore des tutos branché innovation et objets connectés. La technologie est le fil conducteur de tous les articles et l’œil critique est de rigueur.
- 70Lua string hashing library, useful for internationalization
https://github.com/Olivine-Labs/say
Lua string hashing library, useful for internationalization - lunarmodules/say
- 71An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
https://github.com/xanathar/moonsharp
An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities. - moonsharp-devs/moonsharp
- 72Network support for the Lua language
https://github.com/diegonehab/luasocket
Network support for the Lua language. Contribute to lunarmodules/luasocket development by creating an account on GitHub.
- 73A command-line argument parsing module for Lua.
https://github.com/amireh/lua_cliargs
A command-line argument parsing module for Lua. Contribute to lunarmodules/lua_cliargs development by creating an account on GitHub.
- 74A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management. Much of the functionality is inspired by the Python standard libraries.
https://github.com/stevedonovan/Penlight
A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management....
- 75Lua HTTP client cosocket driver for OpenResty / ngx_lua.
https://github.com/pintsized/lua-resty-http
Lua HTTP client cosocket driver for OpenResty / ngx_lua. - ledgetech/lua-resty-http
- 76Assertion library for Lua
https://github.com/Olivine-Labs/luassert
Assertion library for Lua. Contribute to lunarmodules/luassert development by creating an account on GitHub.
- 77An RFC compliant and ESI capable HTTP cache for Nginx / OpenResty, backed by Redis
https://github.com/pintsized/ledge
An RFC compliant and ESI capable HTTP cache for Nginx / OpenResty, backed by Redis - ledgetech/ledge
Related Articlesto learn about angular.
- 1Getting Started with Lua: Beginner's Guide to Scripting
- 2Understanding Lua Tables: Heart of Lua Programming
- 3Game Development with Lua: Building Your First 2D Game
- 4Using Lua for Scripting in Game Engines: Roblox and Corona SDK
- 5Embedding Lua in C/C++ Applications: A Step-by-Step Guide
- 6Building Extensible Software with Lua: Adding Scripting Capabilities to Existing Apps
- 7Optimizing Lua Scripts: Techniques for Speed and Efficiency
- 8Memory Management in Lua: Avoiding Common Pitfalls
- 9Top Lua Libraries for Game Development, Web, and Scripting
- 10Building Web Applications with Lua: OpenResty
FAQ'sto learn more about Angular JS.
mail [email protected] to add more queries here 🔍.
- 1
how popular is lua programming language
- 2
what kind of programming language is lua
- 3
what type of programming language is lua
- 4
are lua and python similar
- 5
what is lua coding used for
- 6
how to make a programming language in lua
- 7
how to code lua
- 8
are lua and javascript similar
- 9
when was lua created
- 10
is lua a programming language
- 11
who created lua programming language
- 12
- 13
what can you do with lua programming
- 14
what is lua programming
- 15
how long does it take to learn lua scripting
- 16
is lua a coding language
- 17
what is lua programming language
- 18
should i learn lua or python
- 19
should i learn lua
- 20
where to learn lua coding
- 21
can lua files be dangerous
- 22
when was lua made
- 23
is roblox lua object oriented programming
- 24
when was lua invented
- 25
does lua compile
- 26
what programming language is similar to lua
- 27
who invented lua
- 28
why use lua programming language
- 29
how hard is lua programming
- 30
can lua be compiled
- 32
what is the lua programming language
- 33
where to learn lua for free
- 34
where can i learn lua
- 35
where is lua programming language used
- 36
is lua programming language
- 38
can lua be used for hacking
- 39
how to learn lua programming
- 40
what does lua stand for programming
- 41
how to learn lua programming language
- 42
what is the lua programming language used for
- 43
is lua the best programming language
- 44
who made lua language
- 45
why is lua used
- 47
what is lua programming language used for
- 48
who created lua
- 49
how long does it take to learn lua coding
- 50
is lua a good programming language
- 51
where is lua used
- 52
why is lua used in games
- 53
what can lua be used for
- 54
how to pronounce lua programming language
- 55
what is lua programming used for
- 56
is lua the easiest programming language
- 57
can lua be used for web development
- 58
was lua created by roblox
- 59
what programming language is lua based on
More Sitesto check out once you're finished browsing here.
0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory