6 Commits

Author SHA1 Message Date
4fd8a2e3ae Merge branch 'master' into fix-container-build
All checks were successful
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m29s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 2m33s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 2m6s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 7m11s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 7m10s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 7m20s
2025-05-22 18:48:40 -04:00
96ffb1fc95 Some shit.
Some checks failed
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Has been cancelled
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Has started running
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Has started running
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Has started running
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Has started running
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Has started running
2025-05-22 18:48:00 -04:00
2d6d0a43f3 The last time I tried this the monkey didn't survive. Let's hope it works better this time. (#2)
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 6m44s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 6m53s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m35s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m29s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m39s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 4m3s
Reviewed-on: Siteworxpro/Php-Template#2
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
2025-05-22 13:07:54 -04:00
63bdc67bb5 Never before had a small typo like this one caused so much damage.
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 1m51s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m57s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 2m39s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m24s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m43s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 2m26s
2025-05-22 13:02:29 -04:00
ec2e668ddd The last time I tried this the monkey didn't survive. Let's hope it works better this time.
All checks were successful
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 9m11s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 9m11s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 12m21s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 12m18s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 12m23s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 3m16s
2025-05-22 12:39:01 -04:00
e203975294 try our sister game minceraft! (#1)
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 2m32s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m30s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 2m43s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 2m53s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 3m2s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 3m8s
Reviewed-on: Siteworxpro/Php-Template#1
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
2025-05-14 12:45:28 -04:00
7 changed files with 122 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
on:
create:
push:
tags:
- '*'
- "v*"
name: 🏗️✨ Build Workflow
@@ -12,7 +12,6 @@ jobs:
steps:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -30,7 +29,7 @@ jobs:
- name: 🏗️ 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 🐳 🔨 Build Backend Container
- name: 🐳 🔨 Build Container
uses: docker/build-push-action@v6
with:
context: .

View File

@@ -14,7 +14,6 @@ jobs:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -75,7 +74,6 @@ jobs:
steps:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -113,7 +111,6 @@ jobs:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -150,7 +147,6 @@ jobs:
steps:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -187,7 +183,6 @@ jobs:
steps:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates
@@ -224,7 +219,6 @@ jobs:
steps:
- name: 🛡️ 🔒 Add Siteworx CA Certificates
run: |
apt update && apt install -yq ca-certificates curl
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
update-ca-certificates

View File

@@ -33,6 +33,7 @@ COPY --from=library /app/vendor /app/vendor
ADD src src/
ADD server.php .
ADD .rr.yaml .
ADD config.php .
EXPOSE 9501

View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Controllers;
use League\Route\Http\Exception\NotFoundException;
use Nyholm\Psr7\ServerRequest;
use Psr\Http\Message\ResponseInterface;
abstract class Controller implements ControllerInterface
{
/**
* @param ServerRequest $request
* @return ResponseInterface
* @throws NotFoundException
*/
public function get(ServerRequest $request): ResponseInterface
{
throw new NotFoundException("not found");
}
/**
* @throws NotFoundException
*/
public function post(ServerRequest $request): ResponseInterface
{
throw new NotFoundException("not found");
}
/**
* @throws NotFoundException
*/
public function delete(ServerRequest $request): ResponseInterface
{
throw new NotFoundException("not found");
}
/**
* @throws NotFoundException
*/
public function patch(ServerRequest $request): ResponseInterface
{
throw new NotFoundException("not found");
}
}

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Controllers;
use Nyholm\Psr7\ServerRequest;
use Psr\Http\Message\ResponseInterface;
interface ControllerInterface
{
/**
* Handle the request and return a response.
*
* @param ServerRequest $request The request data.
* @return ResponseInterface The response data.
*/
public function get(ServerRequest $request): ResponseInterface;
/**
* Handle the request and return a response.
*
* @param ServerRequest $request The request data.
* @return ResponseInterface The response data.
*/
public function post(ServerRequest $request): ResponseInterface;
/**
* Handle the request and return a response.
*
* @param ServerRequest $request The request data.
* @return ResponseInterface The response data.
*/
public function delete(ServerRequest $request): ResponseInterface;
/**
* Handle the request and return a response.
*
* @param ServerRequest $request The request data.
* @return ResponseInterface The response data.
*/
public function patch(ServerRequest $request): ResponseInterface;
}

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Controllers;
use Nyholm\Psr7\ServerRequest;
use Psr\Http\Message\ResponseInterface;
use Siteworxpro\App\Http\JsonResponseFactory;
/**
* Class IndexController
*
* This class handles the index route of the application.
*/
class IndexController extends Controller
{
/**
* Handles the GET request for the index route.
*
* @throws \JsonException
*/
public function get(ServerRequest $request): ResponseInterface
{
return JsonResponseFactory::createJsonResponse(['status_code' => 200, 'message' => 'Server is running']);
}
}

View File

@@ -10,6 +10,7 @@ use League\Route\Http\Exception\MethodNotAllowedException;
use League\Route\Http\Exception\NotFoundException;
use League\Route\Router;
use Nyholm\Psr7\Factory\Psr17Factory;
use Siteworxpro\App\Controllers\IndexController;
use Siteworxpro\App\Facades\Config;
use Siteworxpro\App\Facades\Logger;
use Siteworxpro\App\Http\JsonResponseFactory;
@@ -113,10 +114,7 @@ class Server
*/
protected function registerRoutes(): void
{
$this->router->get('/', function () {
return JsonResponseFactory::createJsonResponse(['status_code' => 200, 'message' => 'Server is running']);
});
$this->router->get('/', IndexController::class . '::get');
$this->router->middleware(new CorsMiddleware());
}