Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ $user
->setCallback(fn (Request $request) => $request->getHeader('x-user-id', 'John Doe'));

$container->set($user);
// Defining Route
Http::get('/hello-world')

// Defining Route
Http::get('/hello-world')
->inject('request') // Auto-injected each request
->inject('response') // Auto-injected each request
->inject('user')
Expand All @@ -67,7 +67,7 @@ $http->start();
Run HTTP server:

```bash
php -S localhost:8000 src/server.php
php -S localhost:8000 src/server.php
```

Send HTTP request:
Expand Down Expand Up @@ -130,7 +130,7 @@ $http->start();

Parameters are used to receive input into endpoint action from the HTTP request. Parameters could be defined as URL parameters or in a body with a structure such as JSON.

Every parameter must have a validator defined. Validators are simple classes that verify the input and ensure the security of inputs. You can define your own validators or use some of [built-in validators](/src/Http/Validator).
Every parameter must have a validator defined. Validators are simple classes that verify the input and ensure the security of inputs. You can define your own validators or use some of [built-in validators](https://github.com/utopia-php/validators).

Define an endpoint with params:

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"require": {
"php": ">=8.1",
"ext-swoole": "*",
"utopia-php/servers": "0.1.*",
"utopia-php/servers": "0.2.*",
"utopia-php/validators": "0.0.*",
"utopia-php/compression": "0.1.*",
"utopia-php/telemetry": "0.1.*"
},
Expand Down
75 changes: 61 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/Getting-Starting-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ use Utopia\Http\Swoole\Response;
use Swoole\Http\Server;
use Swoole\Http\Request as SwooleRequest;
use Swoole\Http\Response as SwooleResponse;
use Utopia\Http\Validator\Wildcard;
use Utopia\Validator\Wildcard;

$http = new Server("0.0.0.0", 8080);

Expand Down Expand Up @@ -284,4 +284,3 @@ If you have PHP and Composer installed on your device, you can run Utopia apps l
> Utopia HTTP requires PHP 8.1 or later. We recommend using the latest PHP version whenever possible.

Wonderful! 😄 You’re all set to create a basic demo app using the Utopia HTTP. If you have any issues or questions feel free to reach out to us on our [Discord Server](https://appwrite.io/discord).

2 changes: 1 addition & 1 deletion example/src/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Utopia\Http\Http;
use Utopia\Http\Response;
use Utopia\Http\Adapter\Swoole\Server;
use Utopia\Http\Validator\Text;
use Utopia\Validator\Text;

class User
{
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<file>./tests/RouterTest.php</file>
<file>./tests/RouteTest.php</file>
<file>./tests/UtopiaFPMRequestTest.php</file>
<directory>./tests/Validator/</directory>
</testsuite>
<testsuite name="e2e">
<file>./tests/e2e/Client.php</file>
Expand Down
22 changes: 0 additions & 22 deletions src/Http/Validator.php

This file was deleted.

86 changes: 0 additions & 86 deletions src/Http/Validator/AllOf.php

This file was deleted.

Loading