Skip to content

Commit 131be41

Browse files
authored
Merge pull request #435 from IncognitoTGT/main
made selecting port easier
2 parents 9077a70 + a9abdac commit 131be41

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ As of January 1st 2024, Replit is [no longer free](https://blog.replit.com/hosti
5454

5555
### Solution for if there is no popup.
5656

57-
1. Edit the `index.js` file and edit the **Port** to a different number, don't use 8080.
58-
2. Click Terminal, and paste `npm i && npm run start`.
59-
3. Go to the ports tab, Click Foward A Port, And type the port number.
60-
4. Right click Visibility and set Port Visibility to Public.
57+
1. Run `npm i`, and before `npm run start`, prepend `PORT=8080`, replacing 8080 with another port. For example, `PORT=6969 npm run start`.
58+
2. Go to the ports tab, Click Forward A Port, And type the port number.
59+
3. Right click Visibility and set Port Visibility to Public.
6160

6261
## Need Help with Deployment?
6362

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const __dirname = process.cwd()
99
const server = http.createServer()
1010
const app = express(server)
1111
const bareServer = createBareServer('/v/')
12-
const PORT = 8080
12+
const PORT = process.env.PORT || 8080
1313
if (config.challenge) {
1414
console.log('Password protection is enabled. Usernames are: ' + Object.keys(config.users))
1515
console.log('Passwords are: ' + Object.values(config.users))

0 commit comments

Comments
 (0)