Skip to content

Commit 25c2364

Browse files
he8usRubenVerborgh
authored andcommitted
Serve front-end assets from node_modules (#863)
1 parent bb8e9e6 commit 25c2364

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

common/css/bootstrap.min.css

Lines changed: 0 additions & 6 deletions
This file was deleted.

common/css/bootstrap.min.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

default-views/account/register-form.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</div>
6868

6969

70-
<script src="https://raw.githubusercontent.com/nowsecure/owasp-password-strength-test/master/owasp-password-strength-test.js"
70+
<script src="/common/js/owasp-password-strength-test.js"
7171
defer></script>
7272
<script>
7373

lib/create-app.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ function createApp (argv = {}) {
5858
routeResolvedFile(app, '/common/js/', 'mashlib/dist/mashlib.min.js.map')
5959
app.use('/.well-known', express.static(path.join(__dirname, '../common/well-known')))
6060

61+
// Serve bootstrap from it's node_module directory
62+
routeResolvedFile(app, '/common/css/', 'bootstrap/dist/css/bootstrap.min.css')
63+
routeResolvedFile(app, '/common/css/', 'bootstrap/dist/css/bootstrap.min.css.map')
64+
routeResolvedFile(app, '/common/fonts/', 'bootstrap/dist/fonts/glyphicons-halflings-regular.eot')
65+
routeResolvedFile(app, '/common/fonts/', 'bootstrap/dist/fonts/glyphicons-halflings-regular.svg')
66+
routeResolvedFile(app, '/common/fonts/', 'bootstrap/dist/fonts/glyphicons-halflings-regular.ttf')
67+
routeResolvedFile(app, '/common/fonts/', 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff')
68+
routeResolvedFile(app, '/common/fonts/', 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff2')
69+
70+
// Serve OWASP password checker from it's node_module directory
71+
routeResolvedFile(app, '/common/js/', 'owasp-password-strength-test/owasp-password-strength-test.js')
72+
6173
// Add CORS proxy
6274
if (argv.proxy) {
6375
console.warn('The proxy configuration option has been renamed to corsProxy.')

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"dependencies": {
4141
"@solid/oidc-auth-manager": "^0.17.0",
4242
"body-parser": "^1.18.3",
43+
"bootstrap": "^3.3.7",
4344
"busboy": "^0.2.12",
4445
"camelize": "^1.0.0",
4546
"colorette": "^1.0.5",
@@ -67,6 +68,7 @@
6768
"node-forge": "^0.7.4",
6869
"nodemailer": "^3.1.4",
6970
"oidc-op-express": "^0.0.3",
71+
"owasp-password-strength-test": "^1.3.0",
7072
"rdflib": "^0.17.1",
7173
"recursive-readdir": "^2.1.0",
7274
"rimraf": "^2.5.0",

0 commit comments

Comments
 (0)