Skip to content

Commit 1b183cf

Browse files
committed
Iniciando a construção do backend
1 parent 73bad6c commit 1b183cf

File tree

115 files changed

+2686
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2686
-0
lines changed

backend/config/db.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = require('../knexfile.js')
2+
const knex = require('knex')()
3+
4+
knex.migrate.latest([config])
5+
module.exports = knex

backend/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const express = require('express')
2+
const app = express()
3+
const bodyParser = require('body-parser')
4+
5+
app.use(bodyParser.json())
6+
7+
app.get('/', (req, res) => {
8+
console.log('/')
9+
res.status(200).send('<h1>Bora de express!</h1>')
10+
})
11+
12+
app.listen(3000, () => {
13+
console.log('Servidor em execução.')
14+
})

backend/knexfile.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Update with your config settings.
2+
module.exports = {
3+
client: "postgresql",
4+
connection: {
5+
database: "tasks",
6+
user: "postgres",
7+
password: "secret"
8+
},
9+
pool: {
10+
min: 2,
11+
max: 10
12+
},
13+
migrations: {
14+
tableName: "knex_migrations"
15+
}
16+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
exports.up = function(knex, Promise) {
3+
4+
};
5+
6+
exports.down = function(knex, Promise) {
7+
8+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
exports.up = function(knex, Promise) {
3+
4+
};
5+
6+
exports.down = function(knex, Promise) {
7+
8+
};

backend/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "tasks_backend",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"start": "nodemon"
8+
},
9+
"dependencies": {
10+
"bcrypt-nodejs": "0.0.3",
11+
"body-parser": "1.19.0",
12+
"consign": "0.1.6",
13+
"cors": "2.8.5",
14+
"express": "4.16.4",
15+
"jwt-simple": "0.5.6",
16+
"knex": "0.16.5",
17+
"moment": "2.24.0",
18+
"passport": "0.4.0" ,
19+
"passport-jwt": "4.0.0",
20+
"pg": "7.10.0"
21+
},
22+
"devDependencies": {
23+
"nodemon": "1.18.11"
24+
}
25+
}

0 commit comments

Comments
 (0)