feat(go): implement server to parse address
This commit is contained in:
18
go/templates/fragments/results.html
Normal file
18
go/templates/fragments/results.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<dl>
|
||||
<dt>Logradouro</dt>
|
||||
<dd>{{ .Result.Road }}</dd>
|
||||
<dt>Número</dt>
|
||||
<dd>{{ .Result.HouseNumber }}</dd>
|
||||
<dt>Unidade</dt>
|
||||
<dd>{{ .Result.Unit }}</dd>
|
||||
<dt>Torre</dt>
|
||||
<dd>{{ .Result.House }}</dd>
|
||||
<dt>Bairro</dt>
|
||||
<dd>{{ .Result.Neighborhood }}</dd>
|
||||
<dt>Cidade</dt>
|
||||
<dd>{{ .Result.City }}</dd>
|
||||
<dt>Estado</dt>
|
||||
<dd>{{ .Result.Estado }}</dd>
|
||||
<dt><abbr title="Có de Endereçamento Postal">CEP</abbr></dt>
|
||||
<dd>{{ .Result.PostalCode }}</dd>
|
||||
</dl>
|
27
go/templates/index.html
Normal file
27
go/templates/index.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Parser de Endereço</title>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
||||
<link rel="stylesheet" href="/static/index.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<section>
|
||||
<div>
|
||||
<input
|
||||
type="search"
|
||||
name="address"
|
||||
placeholder="Endereço: Rua, Número, Complement. Bairro - Cidade/Estado. CEP"
|
||||
hx-get="/parse"
|
||||
hx-trigger="keyup changed delay:500ms"
|
||||
hx-target="#address" />
|
||||
</div>
|
||||
|
||||
<div id="address"></div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user