Skip to content

ch00_installation

Daniel Samson edited this page Jan 18, 2024 · 15 revisions

Create a new project

mkdir new-project
cd new-project
composer init

Get teensyphp

composer require daniel-samson/teensyphp

Create index.php

<?php
require_once __DIR__ . '/vendor/autoload.php';

router(function() {
    // uncomment when using laravel valet:
    // use_request_uri();
    // health check
    route(method(GET), url_path("/"), function () {
        render(200, json_out(['status' => 'up']));
    });

    // Add your endpoints / routes here ...
});
Clone this wiki locally