lint, git, circleci, basics

This commit is contained in:
2023-02-26 15:20:36 +01:00
parent 5b71c1760d
commit f4a7370c5e
5 changed files with 80 additions and 4 deletions

24
.circleci/config.yml Normal file
View File

@@ -0,0 +1,24 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
jobs:
build_and_test:
executor: node/default
steps:
- checkout
- node/install-packages:
pkg-manager: npm
- run:
command: npm run build
name: Build app
- run:
command: npm run test
name: Run tests
- run:
command: npm run build-website
name: Build documentation
- persist_to_workspace:
root: ~/project
paths:
- .

View File

@@ -1,3 +1,12 @@
/*
* myevent - .eslintrc.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
module.exports = {
'env': {
'browser': true,

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
#
# myevent - .gitignore
#
# Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
# https://janishutz.com, development@janishutz.com
#
#
# ignore ALL .log files
*.log
# ignore node_modules (can be rebuilt with npm i --> shrinks repo size)
node_modules

View File

@@ -1 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>myevent - Free & Open Source event management solution</title>
<link rel="stylesheet" href="/css/style.css">
<meta charset="utf-8">
<meta name="description" content="Looking for a free and open source event management solution you can host yourself? myevent is a project that does exactly that.">
</head>
<body>
<h1></h1>
</body>
</html>

View File

@@ -1,3 +1,12 @@
/*
* myevent - app.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
const express = require( 'express' );
let app = express();
const path = require( 'path' );
@@ -8,24 +17,33 @@ const cookieParser = require( 'cookie-parser' );
const favicon = require( 'serve-favicon' );
const http = require( 'http' );
const env = process.env.PROD || false;
const root = process.env.ROOT || '/order';
// initialise express with middlewares
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' ) ) );
// create 404 handler
app.use( ( request, response ) => {
response.sendFile( path.join( __dirname + '' ) );
} );
app.get( '/', ( request, response ) => {
if ( root !== '/' ) {
app.get( '/', ( request, response ) => {
} );
} );
}
const PORT = process.env.PORT || 8080;