Skip to content

Commit

Permalink
Merge pull request #565 from eduquintanilha/fix-nodejs-bugs
Browse files Browse the repository at this point in the history
Fix nodejs bugs
  • Loading branch information
fguisso committed May 31, 2022
2 parents 7dfd990 + cb0d852 commit 46a89c9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion owasp-top10-2021-apps/a1/tictactoe/deployments/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:8.15.1-alpine
WORKDIR /
ADD ./ /
# To workaround 'not get uid/gid'
RUN npm config set unsafe-perm true
RUN apk update && \
npm install package.json && \
npm install -g gulp@3.9.1
CMD gulp && node src/app.js
CMD gulp && node src/app.js
Empty file modified owasp-top10-2021-apps/a1/tictactoe/deployments/check-init.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:

mysqldb:
container_name: mysqldb
image: mysql:5.7
image: mariadb:10.8.3
ports:
- "3307:3306"
volumes:
Expand All @@ -35,4 +35,4 @@ networks:
a5net:

volumes:
db_data:
db_data:
2 changes: 1 addition & 1 deletion owasp-top10-2021-apps/a1/tictactoe/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app.use(bodyParser.urlencoded({extended: true}))
app.use(express.static(__dirname + '/public'));

app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "http://localhost.:10005");
res.header("Access-Control-Allow-Origin", "http://localhost:10005");
next();
});

Expand Down
6 changes: 3 additions & 3 deletions owasp-top10-2021-apps/a1/tictactoe/src/assets/js/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function sendResult(result){
method: 'POST',
body: new URLSearchParams(form)
}
fetch('http://localhost.:10005/game', options)
fetch('http://localhost:10005/game', options)
}

function getCookie(name) {
Expand All @@ -25,7 +25,7 @@ function login(event){
method: 'POST',
body: new URLSearchParams(data)
}
fetch('http://localhost.:10005/login', options)
fetch('http://localhost:10005/login', options)
.then(resp => {
if(!resp.ok){
return resp.json()
Expand Down Expand Up @@ -55,7 +55,7 @@ function createAccount(event){
},
body: new URLSearchParams(data)
}
fetch('http://localhost.:10005/create', options)
fetch('http://localhost:10005/create', options)
.then(resp => {
if(!resp.ok){
return resp.json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ window.onload = function() {
}
const cookie = getCookie('tictacsession')
const payload = JSON.parse(window.atob(cookie.split('.')[1]));
fetch(`http://localhost.:10005/statistics/data?user=${payload.username}`)
fetch(`http://localhost:10005/statistics/data?user=${payload.username}`)
.then(resp => resp.json())
.then(data => {
renderChart(data)
Expand Down
2 changes: 1 addition & 1 deletion owasp-top10-2021-apps/a1/tictactoe/src/public/js/sender.js

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

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

0 comments on commit 46a89c9

Please sign in to comment.