From e536c3ce45e639b16a298c5ceb5ce15df6d9277d Mon Sep 17 00:00:00 2001 From: Pedro Henrique Fernandes Lobo Date: Tue, 20 Oct 2020 21:49:09 -0300 Subject: [PATCH] feat: Encode the url For some reason, I don't know why. It's a good practice to hide information sent by fields. --- src/server.js | 2 ++ src/views/create-orphanage.hbs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index 928a267..eb3e1e2 100644 --- a/src/server.js +++ b/src/server.js @@ -5,6 +5,7 @@ const pages = require('./pages.js'); const server = express(); server + .use(express.urlencoded({ extended: true })) .use(express.static('public')) .set('views', path.join(__dirname, "views")) .set('view engine', 'hbs') @@ -12,5 +13,6 @@ server .get('/orphanage', pages.orphanage) .get('/orphanages', pages.orphanages) .get('/create-orphanage', pages.createOrphanage) + .post('/save-orphanage', pages.saveOrphanage) server.listen(5500) diff --git a/src/views/create-orphanage.hbs b/src/views/create-orphanage.hbs index 49ab315..cd056cd 100644 --- a/src/views/create-orphanage.hbs +++ b/src/views/create-orphanage.hbs @@ -35,7 +35,7 @@
-
+
Dados