Hello, this document contains reasoning as to why your documentation may be miss-leading and questions about the current and future deployment process and how the built project is then served.
So, firstly, I was under the impression, from reading https://www.jexia.com/en/docs/application-hosting that I could host a NodeJS project, as long as it met the requirements of the 256MB of RAM and the NodeJS version of 12.10. This doesn’t seem to be the case as the only thing I seem capable of hosting is a static
From my understanding of testing, the process of deployment is as follows:
npm run build, this is hopefully a build command that looks something like:
vue-cli-service build1, if this command is as so
vue-cli-service build --dest dashboard, changing the output folder from
/dashboardthe deployment process fails.
http-server ./dist -p 80server side and not the projects
This 3rd point is what strikes me as confusing as, according to your documentation, you say you run the
npm run start command to serve the NodeJS project:
As you can see in our example we use next to the start script: "start": "HTTP-server ./dist -p 80". We use HTTP-server to organize serving for static file. Here we listen to port 80 and use the dist folder, which contains our release. More options can be found on the HTTP-server package page. Feel free to implement the approach that suits you. All you need to remember is to use PORT:80 for your server.
And this relates to the
package.json file shown before hand:
A breakdown of your documentation and what it means, or at least how I interpret it as is:
As you can see in our example we use next to the start script: "start": "HTTP-server ./dist -p 80".
This is what you use to start the script, hinting that you recommend the HTTP-server module to start our projects. This is also emphasised below as you give details about the module and how we can customize our project to run on your server using this command:
We use HTTP-server to organize serving for static file. Here we listen to port 80 and use the dist folder, which contains our release. More options can be found on the HTTP-server package page. Feel free to implement the approach that suits you. All you need to remember is to use PORT:80 for your server.
Notice how this repo’s start command is
node index.js, much like my attempted start of
node server.js2, which doesn’t seem to be called on deployment, and with no correlation to the HTTP-server module mentioned within the documentation over on https://www.jexia.com/en/docs/application-hosting. Seeing this within the
package.json file, I proceeded to fork this repo and attempt to host it on my Jexia project. It took about 3 minutes to deploy, which is reasonable, and gave the impression it worked.
When looking through https://github.com/BaileyJM02/pollapp/blob/master/index.js, there is not any middleware I can see being passed to the
express module and request assignment functions therefore it confuses me greatly as to why this works and my project doesn’t. As I’m currently using a simple boilerplate project that does work on my local system but not your live deployment.
The main difference between my application and Pollapp is that my
package.json looks as follows:
Compared to that of Pollapp’s:
As you can see, my
build script builds the VueJS project into a folder named
dashboard and then my
start script simply calls my
server.js file. The same start process as Pollapp. My
dashboard folder is then called via my
As you can see, I statically serve my built dashboard and also, before hand, require my API so it can be called as
<domain>/api/... this, does not work. The project fails to build.
It’s important to note that when my build command was
vue-cli-service build --dest dist, Jexia deployed my Vue application correctly, but failed to correctly call my start command:
node server.js and I suspect it was just using HTTP-server to serve my dist folder.
This leads me to think the deployment process is:
Fetch GitHub repo
npm run build
distfolder -> run a HTTP-serve command.
distfolder created, and “built” is returned, run the
npm run startproject command.
This means, as my project first builds the Vue project then runs a file for logic, your system is seeing that static files have been built in
/dist and just running a static file serve command.
My question regarding the future and your goal of releasing Go deployments in Q4 is: Will we be able to deploy our application in a container-like environment or will it be a strictly event driven code architecture?