Questions tagged [lapis]

For questions related to web framework for Lua and OpenResty.

Lapis is a framework for building web applications using or that runs inside of a customized version of called .

Basic sample in

local lapis = require "lapis"
local app = lapis.Application()

app:match("/", function(self)
  return "Hello world!"
end)

return app

Basic sample in

lapis = require "lapis"

class extends lapis.Application
  "/": =>
    "Hello world!"

See also:

8 questions
3
votes
0 answers

How to install Lapis into a docker container?

I'm just getting started with the Lua framework called Lapis, but I encountered a problem when I tried to install it into a docker cointainer. I’m using the official OpenResty image (jessie), and want to extendmy Dockerfile with a “luarocks install…
Gabor
  • 31
  • 2
2
votes
1 answer

Lua entry thread aborted: runtime error bad argument #2 to 'tonumber' (number expected, got string)

Im using lapis framework and torch, sometimes the website showing internal server error when trying to load page, and the error from lapis is: [error] 3726#81246: *19 lua entry thread aborted: runtime error:…
2
votes
1 answer

How to route to content_by_lua nginx directive depending on both HTTP Action and URL prefix?

I'd like to route all requests sent to my nginx server to my backend application by default, but selectively send API requests with GET HTTP verbs to a OpenResty Lua based REST API backed by a content_by_lua nginx directive. I'm successfully able to…
Eternal Rubyist
  • 3,445
  • 4
  • 34
  • 51
2
votes
1 answer

Lapis not using values from config.moon

I'm following the guides on leafo.net/lapis to create a configuration file. My config.moon is in the top level folder of the app and looks like this config = require "lapis.config" config "development", -> port 5001 When I run lapis build or…
Samo
  • 8,202
  • 13
  • 58
  • 95
1
vote
1 answer

luarocks package installer could not find header file for CRYPTO (crypto.h)

I am trying to install lapis through luarocks. When I run luarocks install lapis, the terminal returns this error: Warning: falling back to wget - install luasec to get native HTTPS support Installing…
Caecilius-rgb
  • 56
  • 1
  • 7
1
vote
1 answer

Lapis - 403 error when accessing /static/ directory. Lapis unable to use port 80

I have Lapis installed and working on Debian 9. I have two beginner issues I need to solve running the simple init setup that serves static content from /static/ and the Lua app from all other requests: I put an index.html file in a directory…
PaulR
  • 706
  • 9
  • 27
1
vote
1 answer

Installing lapis on linux mint (alongside lua 5.3)

A few days ago I had a few problems while installing trying to install lapis on my new installation of linux mint. The main problem was that I wanted to have lua 5.3 as the main lua interpreter on my system, but lapis only works with lua 5.1.
DarkWiiPlayer
  • 6,871
  • 3
  • 23
  • 38
0
votes
1 answer

My lapis server keeps throwing "error 500 Internal Server Error"

I have been experimenting with the lua web framework, lapis, recently. My issue is that when I run lapis server, and try to connect to the website via my browser (localhost:8081), I receive the following error: 500 Internal Server Error. In the logs…
Caecilius-rgb
  • 56
  • 1
  • 7