Restructure static files and main script file

This commit is contained in:
Yarmo Mackenbach 2022-03-15 22:26:10 +01:00
parent cbe7029989
commit 3ae6a59c03
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
21 changed files with 112 additions and 10 deletions

View file

@ -2,7 +2,7 @@
"name": "keyoxide-web",
"version": "3.3.0",
"description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity",
"main": "index.js",
"main": "./src/index.js",
"type": "module",
"dependencies": {
"ajv": "^8.6.3",

View file

@ -33,19 +33,19 @@ import { stringReplace } from 'string-replace-middleware'
import * as pug from 'pug'
import 'dotenv/config.js'
import apiRoute from './routes/api.js'
import mainRoute from './routes/main.js'
import profileRoute from './routes/profile.js'
import staticRoute from './routes/static.js'
import utilRoute from './routes/util.js'
import apiRoute from '../routes/api.js'
import mainRoute from '../routes/main.js'
import profileRoute from '../routes/profile.js'
import staticRoute from '../routes/static.js'
import utilRoute from '../routes/util.js'
const app = express()
const packageData = JSON.parse(readFileSync('./package.json'))
app.set('env', process.env.NODE_ENV || "production")
app.set('env', process.env.NODE_ENV || 'production')
app.engine('pug', pug.__express).set('view engine', 'pug')
app.set('port', process.env.PORT || 3000)
app.set('domain', process.env.DOMAIN || "keyoxide.org")
app.set('domain', process.env.DOMAIN || 'keyoxide.org')
app.set('keyoxide_version', packageData.version)
app.set('onion_url', process.env.ONION_URL)
@ -69,8 +69,8 @@ app.use(stringReplace({
}))
// Routes
app.use('/favicon.svg', express.static('favicon.svg'))
app.use('/robots.txt', express.static('robots.txt'))
app.use('/favicon.svg', express.static('../static/favicon.svg'))
app.use('/robots.txt', express.static('../static/robots.txt'))
app.use('/', mainRoute)
app.use('/api', apiRoute)

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B