Skip to content

Commit

Permalink
chore(*): organize directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Water-Melon committed Nov 15, 2023
1 parent 2af3055 commit 50ec4f4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions index.m → controllers/index.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "@/conf/conf.m"
#include "@/../conf/conf.m"

F = Import('file');
S = Import('sys');
Expand All @@ -12,7 +12,7 @@
}

@index() {
path = S.path('@/index.html');
path = S.path('@/../web/index.html');
f = $F;
if (!f.open(path, 'r')) {
R['code'] = 404;
Expand Down
6 changes: 3 additions & 3 deletions proc.m → controllers/proc.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "@/log.m"
#include "@/validator.m"
#include "@/../utils/log.m"
#include "@/../utils/validator.m"

J = Import('json');
S = Import('sys');
Expand Down Expand Up @@ -211,7 +211,7 @@

for (i = 0; i < n; ++i) {
alias = name + ':' + i;
Eval('@/task.m', J.encode([
Eval('@/../coroutines/task.m', J.encode([
'conf': prog,
'alias': alias,
]), false, alias);
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.m → coroutines/bootstrap.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "@/log.m"
#include "@/../utils/log.m"

sys = Import('sys');

Expand Down
4 changes: 2 additions & 2 deletions http.m → coroutines/http.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "@/proc.m"
#include "@/index.m"
#include "@/../controllers/proc.m"
#include "@/../controllers/index.m"

sys = Import('sys');
net = Import('net');
Expand Down
2 changes: 1 addition & 1 deletion task.m → coroutines/task.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "@/log.m"
#include "@/../utils/log.m"

j = Import('json');
s = Import('sys');
Expand Down
8 changes: 4 additions & 4 deletions meproc.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "@/log.m"
#include "@/utils/log.m"

net = Import('net');
mq = Import('mq');
Expand All @@ -10,10 +10,10 @@
return;
} fi

Log('info', "Meproc v1.0.2. Listen on: " + Conf['ip'] + ':' + Conf['port']);
Log('info', "Meproc v1.0.3. Listen on: " + Conf['ip'] + ':' + Conf['port']);

Eval('@/http.m');
Eval('@/bootstrap.m', nil, false, 'bootstrap');
Eval('@/coroutines/http.m');
Eval('@/coroutines/bootstrap.m', nil, false, 'bootstrap');

while (1) {
fd = net.tcp_accept(listenfd);
Expand Down
2 changes: 1 addition & 1 deletion log.m → utils/log.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if !M_LOG
#define M_LOG
#include "@/conf/conf.m"
#include "@/../conf/conf.m"

Sys = Import('sys');
F = Import('file');
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 50ec4f4

Please sign in to comment.