-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·41 lines (32 loc) · 1.27 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require __DIR__.'/vendor/autoload.php';
use Gishiki\Core\Route;
use Gishiki\HttpKernel\Request;
use Gishiki\HttpKernel\Response;
use Gishiki\Algorithms\Collections\SerializableCollection;
use Gishiki\Gishiki;
Route::get("/", function (Request &$request, Response &$response) {
$result = new SerializableCollection([
"framework" => "https://github.com/NeroReflex/Gishiki",
"info" => "This is a free service used to demonstrate the Gishiki framework",
"list" => "https://github.com/danielmiessler/SecLists/tree/master/Passwords",
"source" => "https://github.com/NeroReflex/HashKraken",
"time" => time()
]);
//send the response to the client
$response->setSerializedBody($result);
});
Route::any(Route::NOT_FOUND, function (Request &$request, Response &$response) {
$result = new SerializableCollection([
"error" => "Not Found",
"time" => time()
]);
//send the response to the client
$response->setSerializedBody($result);
});
Route::get("/setup", "HashedPassword->setup");
Route::get("/hash/{word:string}", "HashedPassword->hash");
Route::post("/hash", "HashedPassword->hash");
Route::get("/reverse/{hash:string}", "HashedPassword->reverse");
//this triggers the framework execution
Gishiki::run();