Skip to content

Commit

Permalink
final adjustments to first version
Browse files Browse the repository at this point in the history
  • Loading branch information
dersonsena committed Sep 19, 2021
1 parent 47672e9 commit 4cdc82e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 0 additions & 4 deletions config/dic.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

$containerBuilder = new ContainerBuilder();

if (APP_IS_PRODUCTION) {
$containerBuilder->enableCompilation(__DIR__ . '/../var/cache');
}

$dependencies = require __DIR__ . '/dependencies.php';
$dependencies($containerBuilder);

Expand Down
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

$app->get('/{path}', AccessUrlController::class);

$app->group('/api/public_html', function (RouteCollectorProxy $group) {
$app->group('/api/public', function (RouteCollectorProxy $group) {
$group->post('/shorten', ShortenUrlController::class);
});
};
12 changes: 6 additions & 6 deletions src/Controllers/AccessUrlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public function __invoke(Request $request, Response $response, array $args): Res
'url_id' => $row['id'],
'created_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s'),
'meta' => json_encode([
'REMOTE_ADDR' => filter_input(INPUT_SERVER, 'REMOTE_ADDR'),
'REMOTE_PORT' => filter_input(INPUT_SERVER, 'REMOTE_PORT'),
'SERVER_NAME' => filter_input(INPUT_SERVER, 'SERVER_NAME'),
'REQUEST_URI' => filter_input(INPUT_SERVER, 'REQUEST_URI'),
'HTTP_HOST' => filter_input(INPUT_SERVER, 'HTTP_HOST'),
'HTTP_USER_AGENT' => filter_input(INPUT_SERVER, 'HTTP_USER_AGENT'),
'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'],
'REMOTE_PORT' => $_SERVER['REMOTE_PORT'],
'SERVER_NAME' => $_SERVER['SERVER_NAME'],
'REQUEST_URI' => $_SERVER['REQUEST_URI'],
'HTTP_HOST' => $_SERVER['HTTP_HOST'],
'HTTP_USER_AGENT' => $_SERVER['HTTP_USER_AGENT']
]),
]);

Expand Down
2 changes: 1 addition & 1 deletion templates/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'layouts/base.html.twig' %}

{% block title %}Encurte uma URL agora{% endblock %}
{% block title %}Url's um tanto pequenas e grátis{% endblock %}

{% block content %}
<div class="home-wrapper">
Expand Down
8 changes: 7 additions & 1 deletion templates/layouts/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Content-Language" content="pt-br">
<meta name="title" content="Smallish">
<meta name="description" content="Smallish - Suas URL's um tanto pequenas. Encurte suas urls de forma rápida e gratuita">
<meta name="keywords" content="encurtador url, gratis, free, url shortener, url, shortener, short url, encurtar url">
<meta name="robots" content="index, follow">
<meta name="language" content="Portuguese">
<meta name="author" content="Cabra Dev">

<!-- Css -->
<link rel="preconnect" href="https://fonts.googleapis.com">
Expand All @@ -25,7 +31,7 @@
</script>
{% block headScripts %}{% endblock %}

<title>{% block title %}{% endblock %} | Smallish</title>
<title>Smallish | {% block title %}{% endblock %}</title>
</head>
<body>
{% include 'layouts/_messages.html.twig' %}
Expand Down

0 comments on commit 4cdc82e

Please sign in to comment.