Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
GITHUB_CLIENT_ID=coder_aluno_9082
GITHUB_CLIENT_SECRET={
PWDASH_= ahsiixo90
}
import {
$env:DB_PASSWORD=link=(url: https://www.mongodb.com/cloud/atlas/hd+pw0012);
}

PORT=3000
DB_NAME=todolist
DB_USER=admin
DB_PASSWORD=link
27 changes: 21 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# This file tells git which files or directories to ignore when committing or pushing to a repository.

# Node.js
node_modules
node_modules.push(
node_modules.join(
----------------------------------------------------------------

_log
.info
.dev
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editors
.vscode
.idea

# OS generated files
Thumbs.db
.DS_Store

# Local env files
(nothing)


4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>Descrição:</h1>
<hr>
<div>
<p>25/02/2025 Desafio ( Refatorar para nosso login ) da Aula 21 ( Estratégia de autenticação de terceiros + JWT ) do curso de Back-end na CoderHouse; Turma #63515 de 2024/25.</p>
</div>
<p>20/03/2025 Desafio ( Reestruturação do nosso servidor ) da Aula 27 ( Arquitetura do Servidor: Design ) do curso de Back-end na CoderHouse; Turma #63515 de 2024/25.</p>
</div>
11 changes: 11 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import dotenv from 'dotenv';
dotenv.config();

export const config = {
port: process.env.PORT,
db: {
name: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD
}
};
14 changes: 14 additions & 0 deletions controllers/taskController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { getAllTasks, addTask } from '../dao/taskDAO.js';

export const getTasks = (req, res) => {
const tasks = getAllTasks();
res.render('index', { tasks });
};

export const createTask = (req, res) => {
const { title } = req.body;
if (title) {
addTask(title);
}
res.redirect('/tasks');
};
7 changes: 7 additions & 0 deletions dao/taskDAO.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let tasks = [];

export const getAllTasks = () => tasks;

export const addTask = (title) => {
tasks.push({ title });
};
Loading