Skip to content
Ip address issue
Profile icon
DhirajBaid

Hey just wanted to know that i use an nodejs api to retirive info so it needs an ip address when i add the ip address it works but when the repl restarts it doesnt work.

Any fixes? or any suggestions for me, thx in advance :)

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
Profile icon
RYANTADIPARTHI

It's probably not saving. Use a database to save the IP address

from replit import db

Use that to save

Profile icon
DhirajBaid

@RYANTADIPARTHI
Im not trying to save the ip im trying to make it not change im using express to host it on local host and it keeps changing (also im using nodejs)

Profile icon
RYANTADIPARTHI

@DhirajBaid
well, that's the point of an API. It changes. You can't do anything about it. Try getting an normal ip.

Profile icon
DhirajBaid

@RYANTADIPARTHI
im trying not mot make repls ip address change because since its on localhost it keeps changing

Profile icon
RYANTADIPARTHI

@DhirajBaid
well, i don't know if you can stop that. i don't think you can