Commits (4)
{
"presets": ["@babel/preset-env", "@babel/preset-typescript", "minify"]
}
\ No newline at end of file
...@@ -4,8 +4,6 @@ pages-testing: ...@@ -4,8 +4,6 @@ pages-testing:
- npm install - npm install
- npm run clean - npm run clean
- npm run build - npm run build
- rm -rf ./built/views
- cp -R ./src/views ./built
- cat $configfiledev > ./built/config/config.js - cat $configfiledev > ./built/config/config.js
- "pm2 delete --silent project || :" - "pm2 delete --silent project || :"
- pm2 start ./built/app.js --name=project - pm2 start ./built/app.js --name=project
......
This diff is collapsed.
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
"url": "https://transfer.hft-stuttgart.de/gitlab/m4lab_tv1/project-page.git" "url": "https://transfer.hft-stuttgart.de/gitlab/m4lab_tv1/project-page.git"
}, },
"scripts": { "scripts": {
"clean-code": "ts-standard --fix",
"check-types": "tsc --noEmit",
"test": "jest",
"start:dev": "nodemon ./src/app.ts", "start:dev": "nodemon ./src/app.ts",
"start": "nodemon ./built/app.js", "start": "nodemon ./built/app.js",
"build": "tsc -build", "clean": "rm -rf ./built",
"clean": "tsc -build --clean", "build": "babel src --out-dir built --extensions .ts --copy-files"
"check-types": "tsc",
"test": "jest",
"cleancode": "ts-standard --fix"
}, },
"dependencies": { "dependencies": {
"async": "^3.2.0", "async": "^3.2.0",
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
}, },
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@types/async": "^3.2.6", "@types/async": "^3.2.6",
"@types/compression": "^1.7.0", "@types/compression": "^1.7.0",
"@types/cookie-parser": "^1.4.2", "@types/cookie-parser": "^1.4.2",
...@@ -49,6 +53,7 @@ ...@@ -49,6 +53,7 @@
"@types/jest": "^28.1.2", "@types/jest": "^28.1.2",
"@types/morgan": "^1.9.2", "@types/morgan": "^1.9.2",
"@types/passport": "^1.0.6", "@types/passport": "^1.0.6",
"babel-preset-minify": "^0.5.2",
"jest": "^28.1.1", "jest": "^28.1.1",
"nodemon": "^2.0.9", "nodemon": "^2.0.9",
"ts-jest": "^28.0.5", "ts-jest": "^28.0.5",
......
...@@ -7,6 +7,7 @@ import helmet from 'helmet' ...@@ -7,6 +7,7 @@ import helmet from 'helmet'
import compression from 'compression' import compression from 'compression'
const env = process.env.NODE_ENV ?? 'testing' const env = process.env.NODE_ENV ?? 'testing'
//import {config} from './config/config'
const config = require('./config/config')[env] const config = require('./config/config')[env]
const lang = 'DE' const lang = 'DE'
......
...@@ -32,9 +32,9 @@ projectConnection.connect(function (err) { ...@@ -32,9 +32,9 @@ projectConnection.connect(function (err) {
}) })
projectConnection.query('USE ' + String(config.database.dbProject)) projectConnection.query('USE ' + String(config.database.dbProject))
const connection = { const dbconn = {
user: userConnection, user: userConnection,
project: projectConnection project: projectConnection
} }
export = connection export {dbconn}
import helpers from '../utils/helpers'
import gitlab from './gitlab'
import https from 'https' import https from 'https'
import {helpers} from '../utils/helpers'
import {gitlab} from './gitlab'
import {dbconn} from '../config/dbconn'
const dbconn = require('../config/dbconn')
const lang = 'DE' const lang = 'DE'
const controller = { const controller = {
...@@ -239,4 +239,4 @@ const controller = { ...@@ -239,4 +239,4 @@ const controller = {
} }
} }
export = controller export {controller}
...@@ -41,4 +41,4 @@ const gitlab = { ...@@ -41,4 +41,4 @@ const gitlab = {
} }
} }
export = gitlab export {gitlab}
import controller from '../controller/controller' import {controller} from '../controller/controller'
module.exports = function (app: any) { module.exports = function (app: any) {
// ======== APP ROUTES - PROJECT ==================== // ======== APP ROUTES - PROJECT ====================
......
...@@ -5,4 +5,4 @@ const helpers = { ...@@ -5,4 +5,4 @@ const helpers = {
} }
} }
export = helpers export {helpers}
...@@ -22,9 +22,10 @@ html(lang="de") ...@@ -22,9 +22,10 @@ html(lang="de")
div(class="container") div(class="container")
div(class="center", align="center") div(class="center", align="center")
a(href="https://m4lab.hft-stuttgart.de") a(href="https://m4lab.hft-stuttgart.de")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192") img(src="https://transfer.hft-stuttgart.de/img/M4_LAB_LOGO.jpg", class="img-responsive center-block", width="185", height="192")
br br
br br
p(class="h5") 404. The requested URL was not found. p(class="h5") 404. The requested URL was not found.
p <a href="./">go back home</a>
// Bootstrap // Bootstrap
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
\ No newline at end of file
...@@ -22,9 +22,10 @@ html(lang="de") ...@@ -22,9 +22,10 @@ html(lang="de")
div(class="container") div(class="container")
div(class="center", align="center") div(class="center", align="center")
a(href="https://m4lab.hft-stuttgart.de") a(href="https://m4lab.hft-stuttgart.de")
img(src="https://transfer.hft-stuttgart.de/images/demo/m4lab_logo.jpg", class="img-responsive center-block", width="185", height="192") img(src="https://transfer.hft-stuttgart.de/img/M4_LAB_LOGO.jpg", class="img-responsive center-block", width="185", height="192")
br br
br br
p <a href="./">go back home</a>
p(class="h5") 500. Unexpected Error :( p(class="h5") 500. Unexpected Error :(
p #{ error } p #{ error }
// Bootstrap // Bootstrap
......
{ {
"exclude": ["node_modules", "__test", "jest.config.js"], "exclude": ["node_modules", "__test", "jest.config.js"],
"compilerOptions": { "compilerOptions": {
"target": "es6", // Target latest version of ECMAScript.
"target": "esnext",
// Search under node_modules for non-relative imports.
"moduleResolution": "node",
"module": "commonjs", "module": "commonjs",
// Enable strictest settings like strictNullChecks & noImplicitAny.
"strict": true, "strict": true,
"outDir": "./built", // Disallow features that require cross-file information for emit. Ensure that Babel can safely transpile files in the TypeScript project
"rootDir": "./src", "isolatedModules": true,
"esModuleInterop": true, // Import non-ES modules as default imports.
"allowJs": true "esModuleInterop": true,
} // Process & infer types from .js files.
"allowJs": true,
// Don't emit; allow Babel to transform files.
"noEmit": true
},
"include": [
"src"
]
} }
\ No newline at end of file