Refactor Project Structure
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ const port = 3000;
|
|||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
const users = JSON.parse(fs.readFileSync('C:/Users/frederik/WebstormProjects/BruteForce/TEST_DATA/users.json', 'utf8'));
|
const users = JSON.parse(fs.readFileSync('TEST_DATA/users.json', 'utf8'));
|
||||||
app.post('/login', (req, res) => {
|
app.post('/login', (req, res) => {
|
||||||
const {username, password} = req.body;
|
const {username, password} = req.body;
|
||||||
const user = users.find(u => u.username === username && u.password === password);
|
const user = users.find(u => u.username === username && u.password === password);
|
||||||
|
|||||||
Reference in New Issue
Block a user