Peradventure/app.lua

68 lines
626 B
Lua
Raw Normal View History

2024-03-16 18:29:52 -05:00
local lapis = require("lapis")
local app = lapis.Application()
2024-03-16 20:00:13 -05:00
local say = require('lua_scripts/main')
2024-03-17 21:20:39 -05:00
local mapFunc = require('lua_scripts/map')
2024-03-17 16:03:28 -05:00
local player = require('player')
local db = require("lapis.db")
local Model = require("lapis.db.model").Model
2024-03-16 18:29:52 -05:00
2024-03-17 21:20:39 -05:00
local map = Model:extend('map')
2024-03-17 16:54:08 -05:00
2024-03-16 18:29:52 -05:00
app:enable("etlua")
2024-03-17 16:03:28 -05:00
app.layout = require "views.layout"
2024-03-16 18:29:52 -05:00
2024-03-16 20:32:35 -05:00
app:post("/clickme", function(self)
self.plane = "P-38L"
2024-03-17 21:20:39 -05:00
mapFunc.populate(self, map)
2024-03-17 16:03:28 -05:00
return {self.plane, layout = false}
2024-03-16 20:32:35 -05:00
end)
2024-03-16 20:00:13 -05:00
app:get("/", function(self)
self.text = say.hello()
2024-03-17 16:03:28 -05:00
return {render = "index",
}
2024-03-16 18:29:52 -05:00
end)
return app
2024-03-16 20:00:13 -05:00
2024-03-16 20:32:35 -05:00
2024-03-17 16:03:28 -05:00
2024-03-16 20:32:35 -05:00
2024-03-16 20:00:13 -05:00
2024-03-17 16:54:08 -05:00
2024-03-16 20:00:13 -05:00