This repository includes ready-to-use Lua modules, tools, Lua scripts, and Lua Server Pages (LSP) examples intended to be dropped directly into real applications or used as practical reference material. The examples span common web and device use cases such as form handling, REST services, AJAX and WebSocket interaction, authentication and session management, database access, IoT messaging, and embedded-specific workflows used with the Barracuda App Server, Mako Server, and Xedge-based systems.
New to Lua? Check out the online Lua tutorial.
- Basic HTML form - Source code for the tutorial HTML Forms and LSP for Beginners.
- Authentication: General - Introduction to the Barracuda App Server's authentication mechanism
- Authentication and Authorization - Shows how to use the JSON Authenticator with a File Server
- Authentication: OAuth 2.0 - Shows how to access GitHub using OAuth 2.0
- Authentication: WebAuthn - Passwordless, FIDO2-compliant security with public-key cryptography
- Authentication: Single Sign On - Prevent Pre-Installed Password Vulnerabilities with Single Sign-On
- Authentication: RADIUS - Remote Authentication Dial-In User Service Lua authentication integration
- AJAX: For Beginners
- AJAX: Over WebSockets
- htmx Examples - htmx lets you update web pages with server-rendered HTML, making it the perfect match for LSP's lightweight, dynamic backend.
- Website Template Engine for Embedded - Fast track your web app design with this engine. Includes TPM-protected user database.
- Dynamic Navigation Menu
- Debug Lua - How to Debug Lua Code Using Visual Studio Code
- GitHub IO - How to make a GitHub repository look and behave like a file system
- IoT: SMQ Examples - Easy and secure device management using SMQ
- IoT: MQTT and AWS - How to Connect to AWS IoT Core using MQTT & ALPN
- IoT: MQTT Sparkplug - How to use the MQTT Sparkplug library
- RESTful - Designing RESTful Services in Lua
- ESP32 Microcontroller Examples - Examples designed for Xedge32
- MinnowSim - Source code for the tutorial Your First Embedded Single Page Application
- MyApp.zip - Ready to run example designed for the tutorial Mastering Xedge Application Deployment: From Installation to Creation
- SQL: SQLite Examples - Database examples
- SQL: MySQL and Redis Examples - Database examples
- SQL: PostgreSQL Example - Database example
- File Upload, including drag and drop - HTML based file upload
- WebDAV and Web-File-Server - Network drive and secure file sharing
- How to add 'require' search path to an app
- Sockets and webSockets examples
- Web Shell - web based alternative to SSH
- The ephemeral request/response environment - using response:include() and response:forward()
- CGI Plugin and Examples - For old apps using Common Gateway Interface
- QNX: PPS to SMQ Bridge - How to extend QNX Persistent Publish Subscribe
Most of the examples include hidden files and/or directories. With the Barracuda App Server, resources starting with a dot are hidden and cannot be accessed by an HTTP client such as a browser. The resources can only be accessed on the server side. To make sure you see all resources, use the Linux command: ls -a