-
Notifications
You must be signed in to change notification settings - Fork 0
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
32 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.vscode | ||
node_modules | ||
. | ||
node_modules |
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
Binary file not shown.
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ module.exports = [ | |
open_on_weekends: "1" | ||
}, | ||
|
||
|
||
{ | ||
id: 2, | ||
lat: "-23.453535", | ||
|
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 |
---|---|---|
@@ -1,32 +1,31 @@ | ||
// NPM = Node Package Manager | ||
// Algo mais ou menos como Gerenciador de pacotes Node | ||
|
||
|
||
// Importar dependência | ||
const express = require('express'); | ||
const path = require('path'); | ||
const pages = require('./pages.js'); | ||
const express = require("express"); | ||
const path = require("path"); | ||
const pages = require("./pages.js"); | ||
|
||
console.log(pages) | ||
// Iniciando o express | ||
console.log(pages); | ||
// Iniciando o express | ||
const server = express(); | ||
|
||
server | ||
// Utilizar body do req | ||
.use(express.urlencoded({ extended: true })) | ||
// Utilizando os arquivos estáticos | ||
.use(express.static('public')) // Express cria todas as rotas que precisa no public | ||
// Utilizar body do req | ||
.use(express.urlencoded({ extended: true })) | ||
// Utilizando os arquivos estáticos | ||
.use(express.static("public")) // Express cria todas as rotas que precisa no public | ||
|
||
// Configurar template engine | ||
.set('views', path.join(__dirname, "views")) | ||
.set('view engine', 'hbs') | ||
// Configurar template engine | ||
.set("views", path.join(__dirname, "views")) | ||
.set("view engine", "hbs") | ||
|
||
// rotas da aplicação | ||
.get('/', pages.index) | ||
.get('/orphanage', pages.orphanage) | ||
.get('/orphanages', pages.orphanages) | ||
.get('/create-orphanage', pages.createOrphanage) | ||
.post('/save-orphanage', pages.saveOrphanage) | ||
// rotas da aplicação | ||
.get("/", pages.index) | ||
.get("/orphanage", pages.orphanage) | ||
.get("/orphanages", pages.orphanages) | ||
.get("/create-orphanage", pages.createOrphanage) | ||
.post("/save-orphanage", pages.saveOrphanage); | ||
|
||
// Ligar o servidor | ||
server.listen(5500) | ||
server.listen(5500); |
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