David Bellerose
David Bellerose
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
So for anyone reading this I had to swap the two properties on either side of the "??" null-coalescing operator. For some reason the original first part _appSettings.TMDBSettings.BaseUrl , being local, should return null on Railway but somehow didn't. I assume it evaluated to something other than null, so the second part of the statement after the ?? was never evaluated. Swapping them allowed the Environment variable to be evaluated first, which returns null locally, but works on Railway since the Environment variable is evaluated first, and is successfully picked up on Railway by the app. var baseUrl = Environment.GetEnvironmentVariable("BaseUrl") ?? _appSettings.TMDBSettings.BaseUrl; At least that's my theory.
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
lol that worked. I can see the api now. I'll make the adjustments to my code. Thanks for all your support and time. much appreciated
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
/*_appSettings.TMDBSettings.BaseUrl ??*/
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
I don't believe so, It is .net mvc 6, I haven't had a need to create a docker file for my .net 6 apps. I did for my .net 8 blazor apps though. I commented out this part in the line 110 I posted above just to test if the "??" part of the line isn't working. Redeploying now. I'll post the result in a few minutes
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
My app api works locally, but not on Railway
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
So the int32 is the count of records to retrieve from the api, and the debugger shows that it is passing into the method correctly, it is not a variable set in the Railway app. From what I can tell the lines of code I posted above, the BaseUrl for example is set as a string. So I'm still thinking that the app can't see the Railway variable for some reason
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
Ah ok I missed that, sorry about that and thanks for pointing that out. 🙂
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
line 110 is the line I posted above for the BaseUrl, can you tell me how it is unrelated? I guess I misunterstood the error
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.NullReferenceException: Object reference not set to an instance of an object. at MoviePro.Services.TMDBMovieService.SearchMoviesAsync(MovieCategory category, Int32 count) in /app/Services/TMDBMovieService.cs:line 110
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
And in another app I can access my email settings ok var host = _mailSettings.MailHost ?? Environment.GetEnvironmentVariable("MailHost");
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
var baseUrl = _appSettings.TMDBSettings.BaseUrl ?? Environment.GetEnvironmentVariable("BaseUrl"); and here is the DATABASE_URL var databaseUrl = Environment.GetEnvironmentVariable("DATABASE_URL");
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
The syntax in my app to access the DATABASE_URL which works is the same to access the BaseUrl,
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
My deployment log says that the BaseUrl is nul
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
No description
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
Are you able to check to see if I entered them correctly? I double checked all the keys and values in the railway variables and in my app to make sure they match.
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
14162ece-686d-4a9e-804f-1f26e3774377
29 replies
RRailway
Created by David Bellerose on 7/10/2024 in #✋|help
Variables syntax
Ok, my asp.net app for some reason can't read my variables, It can read the DATABASE_URL ok, but for some reason it can't read the others.
29 replies
RRailway
Created by David Bellerose on 6/5/2024 in #✋|help
How can I use my own custom domain for an application
ok thanks 😎
11 replies
RRailway
Created by David Bellerose on 6/5/2024 in #✋|help
How can I use my own custom domain for an application
Would this work with a sub domain? For example I wouldn't want the railway application to be in the root domain, like www.myapplication.com, but rather www.mywebsite.com/myapplication
11 replies
RRailway
Created by David Bellerose on 6/5/2024 in #✋|help
How can I use my own custom domain for an application
thanks
11 replies