url-shortener: implements rfd 4 (#65)
* DB Done. Adding new entry in db request Done
* add short url render and redirection
* separate functionality update
* removed global var db
* added two fields in List: owned_id and active?
* fixed minor issues
* db changes
* added NameAlreadyTaken error
* moved address check outside of Create
* changed several minor issues
* chenged opendb func with newsqlitestore
diff --git a/apps/url-shortener/index.html b/apps/url-shortener/index.html
new file mode 100644
index 0000000..15eee68
--- /dev/null
+++ b/apps/url-shortener/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>URL Shortener</title>
+</head>
+
+<body>
+ <h1>URL Shortener</h1>
+
+ <form action="/" method="post">
+ <label for="address">Address:</label>
+ <input type="text" id="address" name="address" required>
+
+ <label for="custom">Custom Name (optional):</label>
+ <input type="text" id="custom" name="custom">
+
+ <button type="submit">Shorten URL</button>
+ </form>
+
+ <h2>Named Addresses:</h2>
+ <table>
+ <tr>
+ <th>Name</th>
+ <th>Address</th>
+ <th>Owner</th>
+ <th>Active</th>
+ </tr>
+ {{ range .NamedAddresses }}
+ <tr>
+ <td><a href="{{ .Name }}" target="_blank">{{ .Name }}</a></td>
+ <td>{{ .Address }}</td>
+ <td>{{ .OwnerId }}</td>
+ <td>{{ .Active }}</td>
+ </tr>
+ {{ end }}
+ </table>
+</body>
+
+</html>