From f36f206058101f6ee631e594b333782996b562a8 Mon Sep 17 00:00:00 2001 From: Robert Jeutter Date: Tue, 10 Nov 2020 09:01:55 +0100 Subject: [PATCH] added more Comments --- config/db-tests.js | 14 +++++++------- config/robots.js | 5 +++++ config/sitemap-generator.js | 9 +++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/config/db-tests.js b/config/db-tests.js index ea9c2eb..6c8207d 100644 --- a/config/db-tests.js +++ b/config/db-tests.js @@ -1,16 +1,16 @@ -var mysql = require('mysql'), - dbconfig= require('./database'), - con = mysql.createConnection(dbconfig.connection); +var mysql = require('mysql'), + dbconfig = require('./database'), + con = mysql.createConnection(dbconfig.connection); // test mysql connection -app.listen(process.env.PORT, process.env.IP, function () { +app.listen(process.env.PORT, process.env.IP, function() { console.log("Server started"); var sql = 'SELECT * FROM ' + dbconfig.database + "." + dbconfig.users_table; - con.query(sql, function (err, rows) { + con.query(sql, function(err, rows) { if (err) { - console.log(err); + console.log(err); //error while connecting } else { - console.log("Database reached successfully"); + console.log("Database reached successfully"); } }); }); \ No newline at end of file diff --git a/config/robots.js b/config/robots.js index f17bc39..150600f 100644 --- a/config/robots.js +++ b/config/robots.js @@ -1,3 +1,8 @@ +/* +Create a Use-Ready robot.txt +More Infos https://www.npmjs.com/package/robotize +*/ + const robotize = require('robotize'); const opts = { useragent: 'googlebot', diff --git a/config/sitemap-generator.js b/config/sitemap-generator.js index ab8fc4f..6c26405 100644 --- a/config/sitemap-generator.js +++ b/config/sitemap-generator.js @@ -1,3 +1,8 @@ +/* +Generate ready to use Sitemap +more Infos: https://www.npmjs.com/package/advanced-sitemap-generator +*/ + const SitemapGenerator = require('advanced-sitemap-generator'); // create generator @@ -7,8 +12,8 @@ const generator = SitemapGenerator('https://XXXXXXX', { // add your site url her filepath: path.join(process.cwd(), 'sitemap.xml'), maxEntriesPerFile: 50000, stripQuerystring: true, - excludeFileTypes: ['ico', 'bmp', 'ogg', 'webp', 'mp4', 'webm', 'mp3', 'ttf', 'woff', 'json', 'rss', 'atom', 'gz', 'zip', 'rar', '7z', 'css', 'js', 'gzip', 'exe', 'svg', 'xml'], - excludeURLs: ['login', 'dashboard'], + excludeFileTypes: ['ico', 'bmp', 'ogg', 'webp', 'mp4', 'webm', 'mp3', 'ttf', 'woff', 'json', 'rss', 'atom', 'gz', 'zip', 'rar', '7z', 'css', 'js', 'gzip', 'exe', 'svg', 'xml'], + excludeURLs: ['login'], changeFreq: weekly, filepath: sitemap.xml // path to be saved });