Remove some unneeded fastify plugins; fix some typos
This commit is contained in:
parent
b4d6482994
commit
8d9e0e8f9f
|
@ -33,7 +33,6 @@
|
||||||
"fastify-caching": "^5.0.0",
|
"fastify-caching": "^5.0.0",
|
||||||
"fastify-compress": "^0.11.0",
|
"fastify-compress": "^0.11.0",
|
||||||
"fastify-cookie": "^3.1.0",
|
"fastify-cookie": "^3.1.0",
|
||||||
"fastify-formbody": "^3.1.0",
|
|
||||||
"fastify-helmet": "^3.0.1",
|
"fastify-helmet": "^3.0.1",
|
||||||
"fastify-jwt": "^1.0.0",
|
"fastify-jwt": "^1.0.0",
|
||||||
"fastify-static": "^2.5.0",
|
"fastify-static": "^2.5.0",
|
||||||
|
@ -41,7 +40,6 @@
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"make-promises-safe": "^5.0.0",
|
"make-promises-safe": "^5.0.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"picnic": "^6.5.1",
|
"picnic": "^6.5.1"
|
||||||
"point-of-view": "^3.5.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ require('make-promises-safe'); // installs an 'unhandledRejection' handler
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
let siteConfig;
|
let siteConfig;
|
||||||
try {
|
try {
|
||||||
siteConfig = require('./config.json.js');
|
siteConfig = require('./config.json');
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.error('Please copy `config.example.json` to `config.json` and fill it with your server\'s data.');
|
console.error('Please copy `config.example.json` to `config.json` and fill it with your server\'s data.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
@ -17,11 +17,9 @@ const fastify = require('fastify')({
|
||||||
fastify.decorate('siteConfig', siteConfig); // Insert siteConfig into global fastify instance
|
fastify.decorate('siteConfig', siteConfig); // Insert siteConfig into global fastify instance
|
||||||
fastify.register(require('fastify-helmet')); // Add security stuff
|
fastify.register(require('fastify-helmet')); // Add security stuff
|
||||||
fastify.register(require('fastify-compress')); // Compress output data for smaller packet delivery
|
fastify.register(require('fastify-compress')); // Compress output data for smaller packet delivery
|
||||||
fastify.register(require('fastify-formbody')); // Enable fastify to parse data sent by POST from forms
|
|
||||||
fastify.register(require('fastify-static'), { // Enable delivering static content efficiently
|
fastify.register(require('fastify-static'), { // Enable delivering static content efficiently
|
||||||
root: path.join(__dirname, 'public'), // all static content will be delivered from the public/ folder
|
root: path.resolve(__dirname, '../public'), // all static content will be delivered from the public/ folder
|
||||||
});
|
});
|
||||||
fastify.register(require('point-of-view'), require('./views/viewSetup')); // Adds the `view()` function to fastify's `reply` objects
|
|
||||||
fastify.register(require('fastify-cookie')); // Enable reading and setting http-level cookies for the sole purpose of storing login tokens
|
fastify.register(require('fastify-cookie')); // Enable reading and setting http-level cookies for the sole purpose of storing login tokens
|
||||||
fastify.register(require('fastify-jwt'), { // Enable creating, parsing, and verifying JSON Web Tokens from the global fastify object
|
fastify.register(require('fastify-jwt'), { // Enable creating, parsing, and verifying JSON Web Tokens from the global fastify object
|
||||||
secret: fastify.siteConfig.jwtSecretKey, // The secret key used to generate JWTs. Make it big and random!
|
secret: fastify.siteConfig.jwtSecretKey, // The secret key used to generate JWTs. Make it big and random!
|
||||||
|
|
28
yarn.lock
28
yarn.lock
|
@ -2653,14 +2653,6 @@ fastify-cookie@^3.1.0:
|
||||||
cookie "^0.3.1"
|
cookie "^0.3.1"
|
||||||
fastify-plugin "^1.4.0"
|
fastify-plugin "^1.4.0"
|
||||||
|
|
||||||
fastify-formbody@^3.1.0:
|
|
||||||
version "3.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/fastify-formbody/-/fastify-formbody-3.1.0.tgz#604cdafdb9e3af6068e6d9940985baf692d6e922"
|
|
||||||
integrity sha512-GQQtRmI8w07SMcnXiWrk9H8GAMJwheKAkQS4q0FbJ56Qu8bV39GOffiZ8GLHQmvcJ2B65S+4IAtNjsG6vtMEig==
|
|
||||||
dependencies:
|
|
||||||
fastify-plugin "^1.0.0"
|
|
||||||
qs "^6.5.1"
|
|
||||||
|
|
||||||
fastify-helmet@^3.0.1:
|
fastify-helmet@^3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/fastify-helmet/-/fastify-helmet-3.0.1.tgz#799f8b4beddec922805c87cc3c6a3151d8946d9c"
|
resolved "https://registry.yarnpkg.com/fastify-helmet/-/fastify-helmet-3.0.1.tgz#799f8b4beddec922805c87cc3c6a3151d8946d9c"
|
||||||
|
@ -2693,7 +2685,7 @@ fastify-jwt@^1.0.0:
|
||||||
jsonwebtoken "^8.3.0"
|
jsonwebtoken "^8.3.0"
|
||||||
steed "^1.1.3"
|
steed "^1.1.3"
|
||||||
|
|
||||||
fastify-plugin@^1.0.0, fastify-plugin@^1.2.0, fastify-plugin@^1.2.1, fastify-plugin@^1.4.0, fastify-plugin@^1.5.0, fastify-plugin@^1.6.0:
|
fastify-plugin@^1.0.0, fastify-plugin@^1.2.0, fastify-plugin@^1.2.1, fastify-plugin@^1.4.0, fastify-plugin@^1.6.0:
|
||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-1.6.0.tgz#c8198b08608f20c502b5dad26b36e9ae27206d7c"
|
resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-1.6.0.tgz#c8198b08608f20c502b5dad26b36e9ae27206d7c"
|
||||||
integrity sha512-lFa9txg8LZx4tljj33oG53nUXhVg0baZxtP9Pxi0dJmI0NQxzkDk5DS9kr3D7iMalUAp3mvIq16OQumc7eIvLA==
|
integrity sha512-lFa9txg8LZx4tljj33oG53nUXhVg0baZxtP9Pxi0dJmI0NQxzkDk5DS9kr3D7iMalUAp3mvIq16OQumc7eIvLA==
|
||||||
|
@ -3097,11 +3089,6 @@ hash.js@^1.0.0, hash.js@^1.0.3:
|
||||||
inherits "^2.0.3"
|
inherits "^2.0.3"
|
||||||
minimalistic-assert "^1.0.1"
|
minimalistic-assert "^1.0.1"
|
||||||
|
|
||||||
hashlru@^2.3.0:
|
|
||||||
version "2.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/hashlru/-/hashlru-2.3.0.tgz#5dc15928b3f6961a2056416bb3a4910216fdfb51"
|
|
||||||
integrity sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==
|
|
||||||
|
|
||||||
he@^1.2.0:
|
he@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
|
||||||
|
@ -4931,14 +4918,6 @@ pn@^1.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
|
resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb"
|
||||||
integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==
|
integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==
|
||||||
|
|
||||||
point-of-view@^3.5.0:
|
|
||||||
version "3.5.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/point-of-view/-/point-of-view-3.5.0.tgz#56ec984e9615f2ddad9b26383f3b73b8f4fab558"
|
|
||||||
integrity sha512-eiv49vaVAUSmrReRKlWgmYJ7wgcr3rGT6eAVuD6HmXTt1AKLY0CgYeu3msGW0n/X4iefdVsfpcPRsttWvS2CGQ==
|
|
||||||
dependencies:
|
|
||||||
fastify-plugin "^1.5.0"
|
|
||||||
hashlru "^2.3.0"
|
|
||||||
|
|
||||||
posix-character-classes@^0.1.0:
|
posix-character-classes@^0.1.0:
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
|
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
|
||||||
|
@ -5440,11 +5419,6 @@ q@^1.1.2:
|
||||||
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
|
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
|
||||||
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
|
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
|
||||||
|
|
||||||
qs@^6.5.1:
|
|
||||||
version "6.8.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.8.0.tgz#87b763f0d37ca54200334cd57bb2ef8f68a1d081"
|
|
||||||
integrity sha512-tPSkj8y92PfZVbinY1n84i1Qdx75lZjMQYx9WZhnkofyxzw2r7Ho39G3/aEvSUdebxpnnM4LZJCtvE/Aq3+s9w==
|
|
||||||
|
|
||||||
qs@~6.5.2:
|
qs@~6.5.2:
|
||||||
version "6.5.2"
|
version "6.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||||
|
|
Loading…
Reference in New Issue