How to recover live URL on replit

I can not find the replit Url after being worked for APIS. I have already been working on that.

https://replit.com/@Elisart/boilerplate-express-4#myApp.js

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36

Challenge: Use body-parser to Parse POST Requests

Link to the challenge:

I’m not sure I understand. You you mean the url of the server? There is a button called “Open Website” - that will open a window with that url.

You can find the URL in the preview window when you run the code.

https://boilerplate-express-4.elisart.repl.co

It also follows the format https://replitName.replitUserName.repl.co so you can derive the live URL from say an editor URL link by rearranging the URL.

The live URL. I pressed something by accident and I can not recover it. WIthout it I can not submit the work on freecodecamp

Can check the version history and see if the progress was saved in their?

I need to recover the live URL , the one at the top of the exercise.

I already did that but doesn`t show the latest changes. It is just a history. When I click the live URL is not there.

even if you have closed the preview window, the live URL is always that. You can try closing replit, reopening it, and running, the preview should be open automatically.

But as lasjorg said, this is your live url

I closed replit and tried to go to the next challenge to see if it still hiddens the live URL( the one on the top right of the page). It doesn`t appear.

You have express code inside your package.json file, that is not valid and will prevent the replit from running.

You have this:
var bodyParser = require(“body-parser”);
…
app.use(bodyParser.json());
app.use(function middle(req, res){
bodyParser.urlencoded({extended: false
  }). extended=false
});

app.post("/name", function(req,res){
var firstName = req.body.first;
var lastName = req.body.last;
res.send({name: firstName + " " + lastName
  });
{
  "name": "fcc-learn-node-with-express",
  "version": "0.1.0",
  "dependencies": {
    "express": "^4.14.0",
    "body-parser": "^1.15.2",
    "cookie-parser": "^1.4.3",
    "fcc-express-bground": "https://github.com/freeCodeCamp/fcc-express-bground-pkg.git"
  },
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "engines": {
    "node": "4.4.5"
  }
};
Should just be this: (no semicolon at the end as well):
{
  "name": "fcc-learn-node-with-express",
  "version": "0.1.0",
  "dependencies": {
    "express": "^4.14.0",
    "body-parser": "^1.15.2",
    "cookie-parser": "^1.4.3",
    "fcc-express-bground": "https://github.com/freeCodeCamp/fcc-express-bground-pkg.git"
  },
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "engines": {
    "node": "4.4.5"
  }
}

You also have a syntax error in your last route (you are missing the closing parentheses).


If the replit has valid code and is serving a page it will open the web view automatically when you run it.

1 Like