mirror of
https://github.com/NotAShelf/catApi.git
synced 2024-11-22 15:40:42 +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();
|
||||
|
||||
// Use tycrek's logging library for fancy messages
|
||||
const TLog = require('@tycrek/log');
|
||||
const logger = new TLog();
|
||||
|
||||
// also configure the timestamps so they don't appear
|
||||
// timestamps look ugly
|
||||
const TLog = require('@tycrek/log')
|
||||
const logger2 = new TLog({
|
||||
timestamp: {
|
||||
enabled: false
|
||||
}
|
||||
/* Options can be set here */
|
||||
});
|
||||
|
||||
// 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.
|
||||
// You will need to handle domain -> raw IP redirection yourself.
|
||||
if(process.env.PORT) {
|
||||
const port = process.env.PORT;
|
||||
const port = process.env.PORT; // Set port variable to the value in .env
|
||||
logger2
|
||||
.success('Custom port is set. Using custom port ' + port)
|
||||
app.listen(port, () => {
|
||||
|
@ -34,7 +33,7 @@ if(process.env.PORT) {
|
|||
const id = path.substring(0, path.length - 4).split('-')[1];
|
||||
return {
|
||||
id: parseInt(id),
|
||||
url: 'https://' + customurl + id,
|
||||
url: 'https://' + customurl + '/' + id,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue