Documentation

Class Phalcon\Server\Http

Source on GitHub

<?php

class App extends Phalcon\Application {
    public function handle($data = NULL):Phalcon\Http\ResponseInterface{
            $response = new Phalcon\Http\Response('hello');
            $response->setHeader("Content-Type", "text/html");
            if ($data) {
                    $response->setContent(json_encode($data));
            }
            return $response;
    }
}

$server = new Phalcon\Server\Http('127.0.0.1', 8989);
  $server->start($application);

Methods

public __construct ([array $config])

Phalcon\Http\Server constructor

public start (Phalcon\Application $application)

Run the Server