The https://frontier.alpha-strike.space/ Application Programmer Interface development repository mostly written in the C++ language utilizing the Crow framework. You may find more information about the amazing Crow framework at https://crowcpp.org/master/ that which makes this service possible.
- Compiler: GCC (>= 10) or Clang (>= 11)
 - CMake: >= 3.14
 - Crow framework (ensure you use the maintained fork, e.g. CrowCpp/Crow)
 - Dependencies: Any dependencies are in the CMakeLists.txt file.
 
# Clone the repository
git clone https://github.com/alpha-strike-space/Application-Programmer-Interface.git
cd Application-Programmer-Interface
# Create and enter a build directory
mkdir build && cd build
# Configure with CMake
cmake ..
# Build the project
makemacOS Users: The standard build process may require extra steps. Please see the detailed macOS Build Guide for specific instructions.
Please make a visit to https://github.com/alpha-strike-space/PostgreSQL-Configuration if you have any questions regarding how the database tables are set up. Now, to run this server in development or production, you must provide the following environment variables so it can connect to the PostgreSQL database:
PGBOUNCER_HOST: Name of Bouncer ServicePGBOUNCER_PORT: Typically, port 6432PGBOUNCER_DB: DB namePGBOUNCER_USER: DB userPGBOUNCER_PASSWORD: DB user password
PGDIRECT_HOST: Name of PG ServicePGDIRECT_PORT: Typically, port 5432PGDIRECT_DB: DB namePGDIRECT_USER: DB userPGDIRECT_PASSWORD: DB user password
You can set these variables in-line when you execute the binary from the project root. Many different ways these variables may be declared. Best practice in run-time is to load them not from a .env file. Although, this is perfectly fine for development.
- The default application port is usually 
8080(check yourServer.cppor config). - On BSD, replace 
makewithgmakeif necessary. 
You can test endpoints using curl or tools like HTTPie:
Note: Cross reference an endpoint and try it out.
curl http://localhost:8080/endpointNote: This is for future reference. We do not have a post function yet.
For POST requests with JSON:
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' http://localhost:8080/endpointFor Websocket connections:
wscat -c ws://localhost/endpoint| Method | Path | Description | 
|---|---|---|
| GET | /health | Health check | 
| POST | /endpoint | Example resource | 
Replace with actual endpoints.
| Path | Description | 
|---|---|
| /mails | Incidents | 
Replace with actual websocket.
- Port in Use: If 8080 is in use, change the port in your Server.cpp.
 - Missing Libraries: Install dependencies using your OS package manager (e.g., 
apt,pkg, orbrew). - Permission Denied: Make sure the binary is executable: 
chmod +x server 
- Use 
gmakeifmakefails. - Ensure you have all developer tools installed: 
pkg install gcc cmake git gmake