Skip to content

Commit

Permalink
Adding some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
emrebilge committed Sep 17, 2023
1 parent 49b2d7b commit 2ee59d9
Show file tree
Hide file tree
Showing 1,169 changed files with 152,949 additions and 0 deletions.
43 changes: 43 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const express = require('express');
const cors = require('cores');
const app = express();
const PORT = 3000;

// app.use(cors()); // this is for security, eventually we need it so that
// see for yourself what happens when you get to the front end stage^

let score = 0;


app.get('/', (req, res) => {
res.send('hello world!');
});

app.get(`/score`, (req, res) => {
res.send(`${score}`);
});


// path not working here:
// app.patch('score', (req, res) => {
// score += parseInt(req.query.val);
// res.send(`${score}`);
// });


// eventually you will need to send the backend a guess, and tell them whether or not it was wrong.
// one way is through status codes, here is one way:
app.patch('/score', (req, res) => {
score += parseInt(req.query.val);
res.status(250).send(`${score}`);
});
// different number ranges mean different things. Will have to do it for later endpoints.


// one more package cors

app.listen(PORT, () => {
console.log(`Backend is running on https://localhost:${PORT}`);
})

// nodemon is not working
12 changes: 12 additions & 0 deletions backend/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/mime.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions backend/node_modules/.bin/nodemon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/nodemon.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/nodemon.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions backend/node_modules/.bin/nodetouch

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/nodetouch.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/nodetouch.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions backend/node_modules/.bin/nopt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/nopt.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/nopt.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions backend/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/semver.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/semver.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2ee59d9

Please sign in to comment.