Ask coding questions

← Back to all posts
repl site name programatically? (in js)
TikiHed (4)

trying to get the repl site name programatically?(in js)... i.e.

thanx for any ....

Answered by EpicGamer007 (1736) [earned 5 cycles]
View Answer
EpicGamer007 (1736)
const url = `${process.env.REPL_SLUG}.${process.env.REPL_OWNER}`
TikiHed (4)

Thanks, this works great ...
Now i can log which repl my bot is coming from ...
https://${ process.env.REPL_SLUG }.${ process.env.REPL_OWNER }

CodeLongAndPros (1624)

What do you mean "repl site name"?
You can make example repls and find the mapping for the names and then: