mirror of
https://github.com/NotAShelf/catApi.git
synced 2024-11-22 23:50:41 +00:00
fix forwardslash at randomImagePath
This commit is contained in:
parent
529e570a06
commit
294c87507c
1 changed files with 5 additions and 6 deletions
11
index.js
11
index.js
|
@ -5,21 +5,20 @@ const fs = require('fs');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
// Use tycrek's logging library for fancy messages
|
// Use tycrek's logging library for fancy messages
|
||||||
const TLog = require('@tycrek/log');
|
// also configure the timestamps so they don't appear
|
||||||
const logger = new TLog();
|
// timestamps look ugly
|
||||||
|
const TLog = require('@tycrek/log')
|
||||||
const logger2 = new TLog({
|
const logger2 = new TLog({
|
||||||
timestamp: {
|
timestamp: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
/* Options can be set here */
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if a custom port is set in .env
|
// Check if a custom port is set in .env
|
||||||
// if it is, then check if a custom url is defined. Paste the correct IP:port combo or the custom url.
|
// if it is, then check if a custom url is defined. Paste the correct IP:port combo or the custom url.
|
||||||
// You will need to handle domain -> raw IP redirection yourself.
|
// You will need to handle domain -> raw IP redirection yourself.
|
||||||
if(process.env.PORT) {
|
if(process.env.PORT) {
|
||||||
const port = process.env.PORT;
|
const port = process.env.PORT; // Set port variable to the value in .env
|
||||||
logger2
|
logger2
|
||||||
.success('Custom port is set. Using custom port ' + port)
|
.success('Custom port is set. Using custom port ' + port)
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
|
@ -34,7 +33,7 @@ if(process.env.PORT) {
|
||||||
const id = path.substring(0, path.length - 4).split('-')[1];
|
const id = path.substring(0, path.length - 4).split('-')[1];
|
||||||
return {
|
return {
|
||||||
id: parseInt(id),
|
id: parseInt(id),
|
||||||
url: 'https://' + customurl + id,
|
url: 'https://' + customurl + '/' + id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue