From 5b71c1760ddc5d9b9943c76018046f1133dc86d5 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sun, 26 Feb 2023 09:51:42 +0100 Subject: [PATCH] initial setup --- .eslintrc.js | 60 ++++++++++++++++++++++++++++++++++ app.js | 32 ++++++++++++++++++ projectWebsite/docs/index.html | 0 projectWebsite/index.html | 1 + 4 files changed, 93 insertions(+) create mode 100644 .eslintrc.js create mode 100644 app.js create mode 100644 projectWebsite/docs/index.html create mode 100644 projectWebsite/index.html diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..7b676c3 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,60 @@ +module.exports = { + 'env': { + 'browser': true, + 'commonjs': true, + 'es2021': true, + 'node': true + }, + 'extends': 'eslint:recommended', + 'overrides': [ + ], + 'parserOptions': { + 'ecmaVersion': 'latest' + }, + 'rules': { + 'indent': [ + 'error', + 4 + ], + 'linebreak-style': [ + 'error', + 'unix' + ], + 'quotes': [ + 'error', + 'single' + ], + 'semi': [ + 'error', + 'always' + ], + 'spaced-comment': [ + 'error', + 'always' + ], + 'arrow-spacing': [ + 'error', + { 'before': true, 'after': true } + ], + 'func-call-spacing': [ + 'error', + 'never' + ], + 'keyword-spacing': [ + 'error', + { 'before': true, 'after': true } + ], + 'key-spacing': [ + 'error', + { 'mode': 'strict' } + ], + 'space-before-blocks': [ + 'error', + 'always' + ], + 'space-in-parens': [ + 'error', + 'always' + ] + } +}; diff --git a/app.js b/app.js new file mode 100644 index 0000000..3365410 --- /dev/null +++ b/app.js @@ -0,0 +1,32 @@ +const express = require( 'express' ); +let app = express(); +const path = require( 'path' ); +const expressSession = require( 'express-session' ); +const fs = require( 'fs' ); +const bodyParser = require( 'body-parser' ); +const cookieParser = require( 'cookie-parser' ); +const favicon = require( 'serve-favicon' ); +const http = require( 'http' ); + +app.use( expressSession( { + secret: 'gaoevgoawefgo083tq2rfvöfaf0p8', + resave: true, + saveUninitialized: true +} ) ); +app.use( bodyParser.urlencoded( { extended: false } ) ); +app.use( bodyParser.json() ); +app.use( cookieParser() ); +app.use( favicon( path.join( __dirname + '/ui/assets/logo.png' ) ) ); + +app.use( ( request, response ) => { + response.sendFile( path.join( __dirname + '' ) ); +} ); + + +app.get( '/', ( request, response ) => { + +} ); + + +const PORT = process.env.PORT || 8080; +http.createServer( app ).listen( PORT ); \ No newline at end of file diff --git a/projectWebsite/docs/index.html b/projectWebsite/docs/index.html new file mode 100644 index 0000000..e69de29 diff --git a/projectWebsite/index.html b/projectWebsite/index.html new file mode 100644 index 0000000..763b073 --- /dev/null +++ b/projectWebsite/index.html @@ -0,0 +1 @@ + \ No newline at end of file