├── .prettierignore ├── .gitignore ├── .gitattributes ├── public └── style.css ├── README.md ├── package.json ├── myApp.js ├── views └── index.html └── server.js /.prettierignore: -------------------------------------------------------------------------------- 1 | .replit -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Tell Linguist to exclude HTML files to help Replit language detection. 2 | *.html linguist-vendored -------------------------------------------------------------------------------- /public/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #ddd; 3 | color: #333; 4 | font-family: sans-serif; 5 | text-align: center; 6 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Information Security with HelmetJS 2 | 3 | This is the boilerplate for the Information Security lessons. Instructions for completing these lessons start at https://www.freecodecamp.org/learn/information-security/information-security-with-helmetjs/ 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fcc-infosec-challenges", 3 | "version": "0.0.1", 4 | "description": "fcc backend boilerplate", 5 | "main": "server.js", 6 | "scripts": { 7 | "start": "node myApp.js" 8 | }, 9 | "dependencies": { 10 | "express": "^4.14.0", 11 | "helmet": "3.21.3" 12 | }, 13 | "keywords": [ 14 | "node", 15 | "hyperdev", 16 | "express", 17 | "freecodecamp" 18 | ], 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /myApp.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | module.exports = app; 51 | const api = require('./server.js'); 52 | app.use(express.static('public')); 53 | app.disable('strict-transport-security'); 54 | app.use('/_api', api); 55 | app.get("/", function (request, response) { 56 | response.sendFile(__dirname + '/views/index.html'); 57 | }); 58 | let port = process.env.PORT || 3000; 59 | app.listen(port, () => { 60 | console.log(`Your app is listening on port ${port}`); 61 | }); 62 | -------------------------------------------------------------------------------- /views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |