Skip to content

Commit c63f75e

Browse files
author
Olivier Bonnaure
committed
Add uploads controller as a start sample
1 parent 4f250db commit c63f75e

File tree

13 files changed

+590
-70
lines changed

13 files changed

+590
-70
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ _system
55
_appbundles
66
foxx
77
node_modules
8-
.env
8+
.env
9+
uploads/*
10+
!uploads/.keep

.init.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ package.path = package.path .. ";config/?.lua;/zip/config/?.lua"
55
-- OTP = require("otp") -- OTP functions
66
require("utilities")
77
require("routes")
8+
print(EncodeJson(Routes))
9+
10+
ProgramMaxPayloadSize(10485760) -- 10 MB
811

912
-- ArangoDB connection
1013
local db_config = DecodeJson(LoadAsset("config/database.json"))
1114
InitDB(db_config)
1215

1316
Views = {}
14-
if BeansEnv == "production" then
15-
LoadViewsRecursively("app/views")
16-
end
1717

1818
-- LastModifiedAt is used to cache the last modified time of the assets
1919
-- so that we can use it to send the correct last modified time to the client
@@ -22,6 +22,9 @@ LastModifiedAt = {}
2222

2323
function OnServerStart()
2424
LoadPublicAssetsRecursively("public")
25+
if BeansEnv == "production" then
26+
LoadViewsRecursively("app/views")
27+
end
2528
end
2629

2730
function OnServerReload()

0 commit comments

Comments
 (0)