Skip to content

Commit

Permalink
#86 : cmdfreak_nginx.conf, cmdfreak.service and makefile update
Browse files Browse the repository at this point in the history
  • Loading branch information
s-takeuchi committed Oct 27, 2024
1 parent f80ccbe commit f23b13b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/restapi/cmdfreak.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=CmdFreak
After=network.service

[Service]
Type=simple
Restart=no
ExecStart=/usr/bin/cmdfreak
ExecStop=/usr/bin/stopcmdfreak sample.conf /usr/bin/cmdfreak
KillMode=process

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions src/restapi/cmdfreak_nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
client_max_body_size 10m;
listen 8080;
listen [::]:8080;
server_name localhost;

location / {
root /usr/share/nginx/html;
index cmdfreak.html index.html index.htm;
}
location /api/ {
proxy_pass http://127.0.0.1:8085;
proxy_read_timeout 1200;
}
}
8 changes: 4 additions & 4 deletions src/restapi/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LDFLAGS = -L/usr/local/lib64 -L/usr/local/lib
LIBS = -lssl -lcrypto -lstdc++ -lodbc -lodbcinst

sample : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o ApiFilterInfo.o ApiOdbcInfo.o DbAccessor.o DbMariaDbAccessor.o DbMySqlAccessor.o DbPostgreSqlAccessor.o OdbcManager.o
cmdfreak : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o ApiFilterInfo.o ApiOdbcInfo.o DbAccessor.o DbMariaDbAccessor.o DbMySqlAccessor.o DbPostgreSqlAccessor.o OdbcManager.o
cd ../../../YaizuComLib/src/stkpl; make
cp ../../../YaizuComLib/src/stkpl/stkpl.a .
cd ../../../YaizuComLib/src/stkwebapp; make
Expand All @@ -17,7 +17,7 @@ sample : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCoun
cd ../../../YaizuComLib/src/stkdata; make
cp ../../../YaizuComLib/src/stkdata/stkdata.a .

g++ -o sample CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o ApiFilterInfo.o ApiOdbcInfo.o DbAccessor.o DbMariaDbAccessor.o DbMySqlAccessor.o DbPostgreSqlAccessor.o OdbcManager.o stkpl.a stkwebapp.a stkwebapp_um.a commonfunc.a stksocket.a stkthread.a stkdata.a -std=c++1z -lstdc++fs -pthread -static-libgcc $(LDFLAGS) $(LIBS)
g++ -o cmdfreak CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o ApiFilterInfo.o ApiOdbcInfo.o DbAccessor.o DbMariaDbAccessor.o DbMySqlAccessor.o DbPostgreSqlAccessor.o OdbcManager.o stkpl.a stkwebapp.a stkwebapp_um.a commonfunc.a stksocket.a stkthread.a stkdata.a -std=c++1z -lstdc++fs -pthread -static-libgcc $(LDFLAGS) $(LIBS)

CmdFreakRestApi.o : CmdFreakRestApi.cpp
g++ -c CmdFreakRestApi.cpp -std=c++1z
Expand Down Expand Up @@ -62,7 +62,7 @@ OdbcManager.o : OdbcManager.cpp
g++ -c OdbcManager.cpp -std=c++1z

clean :
rm -f *.o *.a sample
rm -f *.o *.a cmdfreak
cd ../../../YaizuComLib/src/stkpl; make clean
cd ../../../YaizuComLib/src/stkwebapp; make clean
cd ../../../YaizuComLib/src/stkwebapp_um; make clean
Expand All @@ -71,4 +71,4 @@ clean :
cd ../../../YaizuComLib/src/stkthread; make clean
cd ../../../YaizuComLib/src/stkdata; make clean

all : clean sample
all : clean cmdfreak

0 comments on commit f23b13b

Please sign in to comment.