begin backend implementation

This commit is contained in:
2023-07-08 13:31:42 +02:00
parent ca5ab2d74a
commit be263fcd6b
5 changed files with 44 additions and 1368 deletions

View File

@@ -41,5 +41,6 @@ app.use( ( request, response ) => {
response.sendFile( path.join( __dirname + '/../webapp/dist/index.html' ) );
} );
const PORT = process.env.PORT || 8080;
const PORT = process.env.PORT || 8081;
console.log( 'Server listening on Port ' + PORT );
http.createServer( app ).listen( PORT );

View File

@@ -0,0 +1,27 @@
/*
* libreevent - token.js
*
* Created by Janis Hutz 07/08/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
class TokenGenerator {
genTok () {
let token = '';
let min = 48;
let max = 122;
for ( let i = 0; i < 61; i++ ) {
let randomNumber = Math.floor( Math.random() * ( max - min ) ) + min;
while ( randomNumber === 92 || randomNumber === 58 || randomNumber === 96 || randomNumber === 94 || randomNumber === 64 ) {
randomNumber = Math.floor( Math.random() * ( max - min ) ) + min;
}
token += String.fromCharCode( randomNumber );
}
return token;
}
}
module.exports = TokenGenerator;

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,7 @@
"yocto-queue": "^1.0.0"
},
"dependencies": {
"bcrypt": "^5.1.0",
"bcrypt": "^5.0.1",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
"express": "^4.18.2",

View File

@@ -1,6 +1,7 @@
<template>
<div>
<h1>Account</h1>
</div>
</template>