URL returned is not formatted correctly
See original GitHub issueI am trying to implement the electron release server and for now I am using docker compose to run it on my local machine.
here is my docker-compose.yml
version: '2'
services:
web:
build: .
environment:
APP_USERNAME: admin
APP_PASSWORD: admin
DB_HOST: db
DB_PORT: 5432
DB_USERNAME: releaseserver
DB_NAME: releaseserver
DB_PASSWORD: secret
TOKEN_SECRET: change_me_in_production
APP_URL: 'localhost:5000'
depends_on:
- db
ports:
- '5000:80'
entrypoint: ./scripts/wait.sh db:5432 -- npm start
db:
image: postgres
environment:
POSTGRES_PASSWORD: secret
POSTGRES_USER: releaseserver
When I call the server endpoint http://localhost:5000/update/osx_64/0.0.1
I get json back, but the url in the response is not correct
{
"url": "localhost:/download/0.0.2/osx_64?filetype=zip",
"name": "0.0.2",
"notes": "",
"pub_date": "2017-05-10T23:12:52.000Z"
}
you will notice that the port is missing. So i added some debug to VersionController.js
sails.log.debug('Version candidate accepted');
sails.log.debug('appUrl '+sails.config.appUrl);
sails.log.debug(sails.config.appUrl + '/download/' + latestVersion.name + '/' + latestVersion.assets[0].platform + '?filetype=zip');
sails.log.debug(url.resolve(
sails.config.appUrl,
'/download/' + latestVersion.name + '/' +
latestVersion.assets[0].platform + '?filetype=zip'
));
and what I get back in the debug is
web_1 | debug: Version candidate accepted
web_1 | debug: appUrl localhost:5000
web_1 | debug: localhost:5000/download/0.0.2/osx_64?filetype=zip
web_1 | debug: localhost:/download/0.0.2/osx_64?filetype=zip
it looks like url.resolve() is removing the port. Is there any way to fix this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Page URL not formatted properly to use in email? — oracle-tech
Hi, I am trying to create and send URL from apex.oracle.com but ... if the returned URL is having pls/apex then you can...
Read more >NoMethod Error Given When URL is not formatted properly
The HTTP verb methods should raise an exception upon being given an improper URL as an argument. This exception should specify what URL...
Read more >Http Response Not Formatting Json Data Correctly ASP Core ...
Here is the json data I get when I hit the URL, it is not closing correctly. I have been working on this...
Read more >URL isn't formatting correctly into Gmail when input into ...
Google Form to GMail - I am putting a URL into a field on the form but it is not formatting correctly into...
Read more >Why am I seeing an error 'The link is not formatted properly ...
You are seeing an error when directly clicking on this link as this will not have values for the Parameters on the link....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nevermind, I read this and changed my APP_URL to
http://localhost:5000
and now it works. You should probably change your default yml to have the sameThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.