This file contains hidden or 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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
const bodyParser = require('body-parser') | |
app.use(bodyParser.urlencoded({ extended: false })) | |
const MongoClient = require('mongodb').MongoClient | |
const mongoUri = 'mongodb://<USER>:<PASSWORD>@meu-dinheiro-shard-00-00-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-01-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-02-mrafo.mongodb.net:27017/meu-dinheiro-live?ssl=true&replicaSet=meu-dinheiro-shard-0&authSource=admin' |
This file contains hidden or 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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
const bodyParser = require('body-parser') | |
app.use(bodyParser.urlencoded({ extended: false })) | |
const MongoClient = require('mongodb').MongoClient | |
const mongoUri = 'mongodb://<USER>:<PASSWORD>@meu-dinheiro-shard-00-00-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-01-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-02-mrafo.mongodb.net:27017/meu-dinheiro-live?ssl=true&replicaSet=meu-dinheiro-shard-0&authSource=admin' |
This file contains hidden or 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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
const bodyParser = require('body-parser') | |
app.use(bodyParser.urlencoded({ extended: false })) | |
const MongoClient = require('mongodb').MongoClient | |
const mongoUri = 'mongodb://<USER>:<PASSWORD>@meu-dinheiro-shard-00-00-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-01-mrafo.mongodb.net:27017,meu-dinheiro-shard-00-02-mrafo.mongodb.net:27017/meu-dinheiro-live?ssl=true&replicaSet=meu-dinheiro-shard-0&authSource=admin' |
This file contains hidden or 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
<% include header %> | |
<h2>Calculadora</h2> | |
<form method="GET"> | |
Valor Inicial: <input type="text" name="valorInicial"><br> | |
Taxa a.m.: <input type="text" name="taxa"><br> | |
Quantos Meses: <input type="text" name="tempo"></br> | |
<button type="submit">Calcular</button> | |
</form> | |
<% if(resultado.calculado){ %> |
This file contains hidden or 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
const produtos = [ | |
{ | |
id: 1, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 2, | |
preco: 10.0, | |
qtd: 2 |
This file contains hidden or 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
const produtos = [ | |
{ | |
id: 1, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 2, | |
preco: 10.0, | |
qtd: 2 |
This file contains hidden or 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
const produtos = [ | |
{ | |
id: 1, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 2, | |
preco: 10.0, | |
qtd: 2 |
This file contains hidden or 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
const express = require('express') | |
const app = express() | |
const port = 3000 | |
app.get('/',(request,response) => { | |
const num1 = parseInt(request.query.num1) | |
const num2 = parseInt(request.query.num2) | |
const soma = num1 + num2; | |
response.send(soma.toString()) |
This file contains hidden or 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
const fs = require('fs') | |
function readdirPromise(path){ | |
return new Promise((resolve,reject) => { | |
fs.readdir(path,(err,dirContent) =>{ | |
err ? reject(err) : resolve(dirContent) | |
}) | |
}) | |
} |
This file contains hidden or 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
const fs = require('fs') | |
function readdirPromise(path){ | |
return new Promise((resolve,reject) => { | |
fs.readdir(path,(err,dirContent) =>{ | |
err ? reject(err) : resolve(dirContent) | |
}) | |
}) | |
} |
NewerOlder