update certificate
Signed-off-by: Walamana <joniogerg@gmail.com>
This commit is contained in:
parent
cd90540be2
commit
a285b8e620
18
app.js
18
app.js
@ -29,7 +29,7 @@ con.connect(err => {
|
|||||||
|
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
if(!isConnected()){res.send("No Connection to database<br>" + JSON.stringify(cause) + "<br>" + toString(con));return}
|
if(!isConnected()){res.send("No Connection to database<br>" + JSON.stringify(cause) + "<br>" + fs.readFileSync(process.cwd() + "/mysql-ca.ctf"));return}
|
||||||
res.send("Welcome to the miniplan api!");
|
res.send("Welcome to the miniplan api!");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -144,22 +144,6 @@ app.listen(3000, () => {
|
|||||||
console.log("API started!");
|
console.log("API started!");
|
||||||
});
|
});
|
||||||
|
|
||||||
function toString(string){
|
|
||||||
var cache = [];
|
|
||||||
var r = JSON.stringify(string, function(key, value) {
|
|
||||||
if (typeof value === 'object' && value !== null) {
|
|
||||||
if (cache.indexOf(value) !== -1) {
|
|
||||||
// Circular reference found, discard key
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Store value in our collection
|
|
||||||
cache.push(value);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
cache = null; // Enable garbage collection
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isConnected(){
|
function isConnected(){
|
||||||
if(con.isConnected){
|
if(con.isConnected){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user