'I am using expressjs and when I heroku deploy my site going to cruch
I am trying to deploy my project on hreoku but I got the error
2022-05-20T07:45:17.754377+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=agro-log.herokuapp.com request_id=80aa6ef2-1c4c-4541-aaf5-c54e8b0cdec5 fwd="103.151.119.18" dyno= connect= service= status=503 bytes= protocol=https
I as also trying chenage my port but It's not working
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Our app is running on port ${ PORT }`);
});
Solution 1:[1]
Please add a root endpoint for the application.
something like
app.get("/", (req,res)=>{
res.send({message:"hello world"})
})
Solution 2:[2]
You can use the removeAttribute() method of HTMLElement.
First, you need to select the element. There are several ways, I prefer to use querySelector().
The query selects a a element with the class cart-contents and the attribute data-toggle.
Then, simply call the removeAttribute method.
Full Code
const $toRemoveAttrElem = window.document.querySelector("a.cart-contents[data-toggle]");
$toRemoveAttrElem.removeAttribute("data-toggle");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MUGABA |
| Solution 2 | sean-7777 |
