added more Comments

This commit is contained in:
Robert Jeutter 2020-11-10 09:01:55 +01:00
parent f69a361b40
commit f36f206058
3 changed files with 19 additions and 9 deletions

View File

@ -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");
}
});
});

View File

@ -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',

View File

@ -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
});