added compression to crow
This commit is contained in:
@@ -89,11 +89,15 @@ target_link_options(${TARGET_NAME} PRIVATE
|
||||
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
APPLICATION_NAME="${TARGET_NAME}"
|
||||
SQLITE_THREADSAFE=1
|
||||
ASIO_STANDALONE
|
||||
SQLITE_THREADSAFE=1 # build sqlite with thread safty
|
||||
ASIO_STANDALONE # use asio without boost
|
||||
CROW_ENABLE_COMPRESSION # enable compression part of crow
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} pthread)
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
pthread
|
||||
z # zlib, used by crow for compression
|
||||
)
|
||||
|
||||
# Optional: Print build type at configuration time
|
||||
message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}")
|
||||
3
PKGBUILD
3
PKGBUILD
@@ -1,7 +1,7 @@
|
||||
# Maintainer: Lukas Forsberg lukas96.forsberg@gmail.com
|
||||
|
||||
pkgname=shadowrun-server
|
||||
pkgver=0.1.2
|
||||
pkgver=0.1.3
|
||||
pkgrel=1
|
||||
arch=('x86_64')
|
||||
depends=()
|
||||
@@ -13,6 +13,7 @@ source=(
|
||||
)
|
||||
install=shadowrun-server.install
|
||||
md5sums=('SKIP') # SKIP if local files
|
||||
depends=('zlib') # used for compression by crow
|
||||
build() {
|
||||
cmake -S "${srcdir}" \
|
||||
-B build \
|
||||
|
||||
@@ -32,7 +32,7 @@ npm run build
|
||||
1. tar the source files to make it cleaner
|
||||
|
||||
```
|
||||
tar czf shadowrun-server-0.1.2.tar.gz source/ modules/ assets/ frontend/build/ shadowrun-server.service CMakeLists.txt shadowrun-server.install
|
||||
tar czf shadowrun-server-0.1.3.tar.gz source/ modules/ assets/ frontend/build/ shadowrun-server.service CMakeLists.txt shadowrun-server.install
|
||||
```
|
||||
|
||||
2. create the package
|
||||
@@ -43,7 +43,7 @@ makepkg -f
|
||||
|
||||
3. place the package in archrepo on server
|
||||
```
|
||||
scp shadowrun-server-0.1.2-1-x86_64.pkg.tar.zst lukas@192.168.1.101:/home/lukas/Drive/archrepo/x86_64/
|
||||
scp shadowrun-server-0.1.3-1-x86_64.pkg.tar.zst lukas@192.168.1.101:/home/lukas/Drive/archrepo/x86_64/
|
||||
```
|
||||
|
||||
4.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "login.hpp"
|
||||
#include "ShadowrunApi.hpp"
|
||||
#include "databasepool.h"
|
||||
#include "crow/compression.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -74,5 +75,9 @@ int main() {
|
||||
});
|
||||
|
||||
app.loglevel(crow::LogLevel::INFO);
|
||||
app.bindaddr("0.0.0.0").port(settings.http_port).multithreaded().run();
|
||||
app.bindaddr("0.0.0.0")
|
||||
.port(settings.http_port)
|
||||
.use_compression(crow::compression::algorithm::GZIP)
|
||||
.multithreaded()
|
||||
.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user