the beginning of the idiots
This commit is contained in:
53
qwen/hack/public/index.php
Normal file
53
qwen/hack/public/index.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?hh // strict
|
||||
|
||||
/**
|
||||
* Main application entry point for MerchantsOfHope
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/bootstrap.php';
|
||||
|
||||
use App\Controllers\HomeController;
|
||||
use Slim\Factory\AppFactory;
|
||||
use Slim\Middleware\ContentLengthMiddleware;
|
||||
use Slim\Routing\RouteCollectorProxy;
|
||||
|
||||
// Set up the Slim application
|
||||
AppFactory::setContainer($container);
|
||||
$app = AppFactory::create();
|
||||
|
||||
// Add middleware
|
||||
$app->addBodyParsingMiddleware();
|
||||
$app->addRoutingMiddleware();
|
||||
$app->add(new ContentLengthMiddleware());
|
||||
|
||||
// Define routes
|
||||
$app->get('/', [HomeController::class, 'index']);
|
||||
|
||||
// Group routes for API
|
||||
$app->group('/api', function (RouteCollectorProxy $group) {
|
||||
// Authentication routes
|
||||
$group->post('/auth/login', [App\Controllers\AuthController::class, 'login']);
|
||||
$group->post('/auth/logout', [App\Controllers\AuthController::class, 'logout']);
|
||||
$group->post('/auth/register', [App\Controllers\AuthController::class, 'register']);
|
||||
|
||||
// Job seeker routes
|
||||
$group->get('/jobs', [App\Controllers\JobController::class, 'listJobs']);
|
||||
$group->get('/jobs/{id}', [App\Controllers\JobController::class, 'getJob']);
|
||||
$group->post('/applications', [App\Controllers\ApplicationController::class, 'apply']);
|
||||
|
||||
// Job provider routes
|
||||
$group->get('/my-jobs', [App\Controllers\JobController::class, 'myJobs']);
|
||||
$group->post('/jobs', [App\Controllers\JobController::class, 'createJob']);
|
||||
$group->put('/jobs/{id}', [App\Controllers\JobController::class, 'updateJob']);
|
||||
$group->delete('/jobs/{id}', [App\Controllers\JobController::class, 'deleteJob']);
|
||||
});
|
||||
|
||||
// Add error middleware in development
|
||||
if (APP_ENV === 'development') {
|
||||
$app->addErrorMiddleware(true, true, true);
|
||||
} else {
|
||||
$app->addErrorMiddleware(false, false, false);
|
||||
}
|
||||
|
||||
// Run the application
|
||||
$app->run();
|
||||
Reference in New Issue
Block a user