Steam Web API via Node.js on my shared hosting - node.js

Basically, what I'm trying to do is have the Steam Web API running via Node.js on my shared hosting so I can display Steam user profile information on my site. Unfortunately, I'm having a lot of trouble getting it working. I've been following this guide.
This is what I followed to get NodeJS running.
I have it set up like so:
Node.js version - 9.11.2
Application mode - Production
Application root - /home/<name>/nodejs/steamapi-server
Application URL - <mysite.com>/steamapi-server
Application startup file - server.js
My server.js file (minus my API key).
My package.json file.
All dependencies are installed and the script is running.
However, when I go to /steamapi-server all I get is: Cannot GET /steamapi-server/ whereas I would normally be seeing "Hello, World!".
I tested this all locally beforehand and it was working.

Turns out I needed to change app.get('/' to app.get('/steamapi-server'
Now it's working.

Related

Deploying Node.js on Evennode

I deployed my node.js app on Evennode using the git command line. On the logs i saw that app was deployed successfully because "db connection successful" is showing on the logs and there are no errors. However, when i try to visit the url it doesn't show any page. I copied the build folder from react to the backend directory so that the node app can read the react build folder from there and render client side. But it seems the app is not able to read the build folder which works fine on heroku but on even node, its not displaying my client side.
I have no idea why it couldn't read my client side build folder so i came to ask to find solutions

Unable to deploy a node.js / vue.js SPA online

I'm working on a project for adding an external pre-registration page with Stripe to a Wordpress website.
The wordpress is already in place. But the pre-registration page needed the Stripe module, working on back-end...
So I've decided to make a SPA outside this wordpress to have this pre-registrations set up for the next customers.
But now, I'm struggling from days to find how to put this project online, I may definitely need your help for that.
I have this file structure:
File structure
It's nothing more than a single page + a single css file and a single server.js file, that I need to start to interact with the Stripe API.
But I also need some modules like Stripe, which is the key function of this project.
I thought about bundling it with webpack (only the back-end, as the front is only composed of 1 html and 1 css file). Then upload it on my web host.
Haven't found any working way to do so.
I'd like to try some cloud services like Netlify, but I don't even think that it could work without bundling the server side
Everything works perfectly on localhost, but I'm absolutely unable to make it works in prod with a real domain name. And I'm already late to deliver it.
Do you have an idea on how I could do that?
Thanks

Electron with React and OIDC authenticatino works at DEV but fails at PROD

So I built an app I wanted with all blows and whistles including integration with OpenID Connect (OIDC "oidc-client").
Problem is it works only at DEV environment, since electron spins local server for it, so when I'm redirected after identification my app in DEV mode listense to "localhost:3000" and oidc-client can proceed with saving token and other things.
But, once I have built a production version, electron serves react as a static files, so all URL are now "file://....", and once I'm redirected after identification this time, no one is there to listen at OIDC callback at "localhost:3000". I drilled the docs of electron and OIDC but haven't found even one example on how to implement this case.
Anyone have successfully "listened" to callbacks at production version in Electron? The only option I have in mind is to spin up a server at prod and listen to "localhost:3000", but than the question is where to redirect it, so OIDC will catch it? I'll appreciate any input, thank you in advance.
Here some visual explanation of what I described.
Hmm - how are you packaging the app? I have a couple of Electron samples you could compare against, both of which you can run pretty easily against my cloud API and Authorization Server:
Loopback Sample using Plain Typescript
Private URI Scheme using React + Webpack
In both cases I can run a packaged app via 'npm run pack'. In my case I am using electron-packager to build release binaries.
I use AppAuth-JS and here is my code to listen on a loopback URL.
Not sure I fully understand your problem, but hopefully it gives you a few pointers.

add a base url or context root for a node js application

I am writing a python script for auto deployment of node js application which will run behind nginx proxy server.How is it possible to mention a base url for a particular app. Like suppose I am deploying a health application and suppose the url is http://localhost:9000/. So I want to run it using http://localhost:9000/health/ . I know that is possible if i mention it inside application explicitly. But is there anyway to mention it via command prompt or in package.json file.
Please help

Mailing functionality using node.js's nodemailer fails in openshift

I have an issue with nodemailer support in openshift. I created a simple node.js application that sends a mail using nodemailer, following the hello world example given in https://github.com/andris9/Nodemailer
The mail is sent from a gmail id to two other gmail ids. This functionality is invoked while rendering the home page of my application. It worked well when the node.js application was run locally. I created a node js application in openshift and tested the application locally. I worked well. But on deploying the app to open shift, the mailing functionality failed, though the home page was rendered properly.
Is this mailing feature supported in openshift? Or am I missing something, like some extra configuration that is required in openshift for enabling this mailing support?
Thanks.
Hmm, this should work ... can you try changing the port # you are using -- say try 587 with TLS in the
wellknown.js configuration. See if that works.
The other thing to check is that your email provider allows authenticated connections from Amazon AWS EC2 hosts.
HTH

Resources