-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,11 @@ | |
|
||
class RouteName | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
final public const ROOT = 'root'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Safe NFT Metadata Provider package. | ||
* | ||
* (c) Marco Lipparini <developer@liarco.net> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Controller; | ||
|
||
use App\Config\RouteName; | ||
use App\Contract\AbstractNftController; | ||
use RuntimeException; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
/** | ||
* @author Marco Lipparini <developer@liarco.net> | ||
*/ | ||
#[Route( | ||
'/', | ||
name: RouteName::ROOT, | ||
)] | ||
final class RootController extends AbstractNftController | ||
{ | ||
public function __invoke(): Response | ||
{ | ||
$websiteUrl = $this->getParameter('app.collection_website'); | ||
|
||
if (! is_string($websiteUrl)) { | ||
throw new RuntimeException('Invalid collection website.'); | ||
} | ||
|
||
return $this->redirect($websiteUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
{% block title %}Not found!{% endblock title %} | ||
|
||
{% block stylesheets %} | ||
<style> | ||
body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } | ||
.container { margin: 30px; max-width: 600px; } | ||
h1 { color: #dc3545; font-size: 24px; } | ||
h2 { font-size: 18px; } | ||
a, a:visited, a:active, a:link, a:hover { color: inherit; font-weight: bold; text-decoration: underline; } | ||
p.small { font-size: .7em; } | ||
</style> | ||
{% endblock stylesheets %} | ||
|
||
{% block body %} | ||
<div class="container"> | ||
<h1>Oops! An Error Occurred</h1> | ||
<h2>The server returned a "404 Not Found".</h2> | ||
|
||
<p> | ||
The requested resource cannot be found, please visit our | ||
<a href="{{ collection_website }}">collection website</a> | ||
for more information about the project. | ||
</p> | ||
|
||
{# | ||
The credits below help spreading the word about the project and make the | ||
development possible. Please consider leaving them as they are. | ||
If you wish to put some credits in your website too that would be amazing! :) | ||
#} | ||
<p class="small"> | ||
This API was built using the | ||
<a href="https://github.com/liarco-network/safe-nft-metadata-provider" target="_blank">safe NFT metadata provider</a> | ||
by <a href="https://www.liarco.net" target="_blank">Liarco.net</a>. | ||
</p> | ||
</div> | ||
{% endblock body %} |