Hey @Ash13-Dev, I’m a little confused by what you mean when you refer to Chrome’s dev console in this context. Chrome’s console won’t have any knowledge of tracking.js on the server. What exactly are you doing and what’s your expected result?
by console I’m referring to the output tab/console tab which outputs errors, logs, etc. It keeps informing me that ‘require’ is not defined in tracking.js
I am trying to get tracking.js to use a certain NPM package to execute functions. I then link this script to all my html files so I can access those functions from other scripts.
I will probably just stop using glitch as it works fine, but it doesn’t do what I need it to. It cannot run php and node in one project, it fails to give good info, and you cannot upload most file types directly to the project without it just going to assets. If you could at all help me I would appreciate it.
I’m happy to help however I can, and we definitely don’t want to see you go if we can avoid it.
You’re right that if you’re trying to use both php and node in a single project to serve external requests that won’t work, since each process needs to listen to a different port, but we only open a single port in the project’s container. That’s not likely to change in the near future. You might be able to proxy those requests somehow, and you could certainly run your php and node processes in different projects and route to each of them from a proxy project as appropriate, but that’s getting a little complicated.
I’m curious what info you’re looking for that we’re not supplying; depending on what it is that’s something I might be able to take back to the rest of the team.
Similarly with upload - what file types are you trying to upload that are going to assets that you’d rather didn’t? A couple of general notes about this:
asset management will be changing at some point in the not-too-distant future
file allocations are based on file type, so if something unexpected is occurring there we might be able to take a look at it (keeping in mind point #1).
you can always use wget in the console to download a file into the filesystem and put it wherever you want it.
Thanks for trying to help,
I will stick with glitch due to the simplicity of hosting however, I am not able to remember what file types but there are a few I’d like to upload that I just couldn’t. Also I won’t be needing PHP but I still need help with the original question. Which is: How can I use server.js to send back info.
So basically I want the client script to send some sort of request and tell the server script to give it info for this package. The server will then return that info to the client.
Hi @Ash13-Dev sorry this sort of dropped by the wayside.
It seems like you’ve made some progress and are headed the right direction of wrapping your server-side processes in an API that you can use from your client. I note that sending tracking info to pages/trackAPI.html results is detailed tracking data being logged to the console.
Are you all set then, or do you still have open questions?