How to deploy Libgdx game into the real web server - html

I built the Libgdx game with Gradle and success in deployment on localhost. So I move the code into the real server. However, when I open the browser of my game..it seems like the browser reads url (localhost). Nothing appear!! I am wondering if I have to set up more info for javascript to run the game on the real server or in config files somewhere ?

How you build web-server version of your project? You should use this command:
$ ./gradlew html:dist
Results files will be inside folder: html/build/dist
You should copy all files to webroot folder of your vhost.
Structure should be something like this:
assets
html
index.html
soundmanager2-jsmin.js
soundmanager2-nodebug-jsmin.js * - i also download from soundmanager website nodebug version of soundmanager
soundmanager2-setup.js
styles.css
I was programming gwt project few times. For example: http://ciufcia.pl/boomki-nimm2.
If this does not help, please give some logs from webconsole.

Related

Hidding Servers Filesystem in Gatsby / ReactJS?

I am about to learn ReactJS.
I want to hide the filesystem structure of my server and only show the project root.
If i go to inspect tools in google-chrome i can see where my project is located on my C: Drive.
Wasnt able to find something about it and Ive got no Idea.
Hopefully, someone can help me.
This is because you are using your computer as a server to serve your site so the inspect tools are able to recognize the origin of the code, assets, and images.
Locally, even using gatsby develop or gatsby build (and gatsby serve) you will always be able to see the root of your project, it happens with all web development files, not only in Gatsby.
In a real scenario, where it's a server (with a domain attached, not your PC) that serves the files you will never see the origin because your site will be placed in the /public or /www of your server. To prepare your project to be deployed, you should run gatsby build command, which will create a /public folder in the root of your project with your code compiled, that folder is the one that needs to be deployed.
This is normal in development environment, for deploy your project try one of these approach in root of you project:
npm build
or
yarn build
This command build an optimized version of your project in build folder, after you can upload content of this folder to your www/plulic folder of your server,

Testing local website with Protractor

I am developing simple website (html, css) and I want to write few tests against it in Protractor.
Is it possible to check that kind of website with Protractor? I have html file on my computer only. Should I run this website locally on server? I don't think I can run test on file directly.
Yes, its possible to open a stand-alone local html file without hosting it on a local server.You have to add this browser.resetUrl = "file:///"in your onPrepare() function and then a browser.get("file:///C:/Users/demo/test.html") would work
There are some good examples #this question - Opening a file with protractor
A common way to do it is to approach it in multiple steps:
build your application
run a local web server from the build directory (I think this is the part you are asking about)
run tests against your app served by the local web server
stop the local web server
Usually, this multi-step process is handled by a task runner like grunt or gulp. We use grunt, grunt-contrib-connect to serve from a directory, grunt-protractor-runner to run protractor from grunt.

How to perform grunt remote debug in IntelliJ IDEA?

I build and run my typescript application by Grunt and connect(grunt-contrib-connect) and livereload plugins. While grunt compile .ts files, it also generate sourcemap. My application is oppening on google chrome. How can I remotely connect by Intellij Idea to this application that was run by Grunt and oppened in Chrome for perform debug?
This post is my last hope, that it is possible. Thanks
create a new javascript debug run configuration
in URL field, specify the URL of your client app (http://localhost:9001/index.html or whatever it looks like)
if your local project structure doesn't exactly match the app structure on server (for example, static files are served from <project_root>/public folder), specify remote URL mappings (see http://confluence.jetbrains.com/display/WI/Starting+a+JavaScript+debug+session#StartingaJavaScriptdebugsession-Startingadebugsessionwhenusingadifferentwebserver)
that should be enough... Start grunt, and, when the server is up and running, debug the configuration above
Thank you. I found solution.
First of all, I need Jet Brains extension for Chrome.
I need to make configure debug mode "JavaScript debug" and specify URL that grunt will run and open application.
Run Grunt task that build and open application in browser.
Run debug mode that just reload same page under debugger already.
Don't forget enjoy it.
Since I use typescript, ability to debug in IDE was very important.

How to Deploy html project using gradle in libgdx

I have successfully run my html project using following command
gradlew html:superDev
And after that I run "gradlew html:dist" command .
This compiled my app to Javascript and place the resulting Javascript, HTML and asset files in the html/build/dist/ folder.
Now my question is how to use this "dist" folder to run my project on server.
I tried to upload this "dist" folder on my server and then runs it's index.html file but only superDev Refresh button appears.
Please tell me what are the steps to follow after creating the dist folder ?
Which files and folder should I upload on server ?
Hi I solved it by taking following steps:-
In eclipse I right click on html project and compile it using GWT compile.
2 then run the html project as web application.
3 After successfully launching of the game I copy all the folders excepts WebInf from the war folder and place them in a new folder then upload it on server.
That's it.
But through Gradle I did not get any success.

Subdirectories in openshift project cannot be found

I built a site using a php openshift project and accessing the root directory via http works fine. However, all the root directories give me a 404 not found, like this one: http://test.toppagedesign.com/sites/
I checked with ssh, and /app-root/repo/sites and app-deployments/current/repo/sites/ both exist.
EDIT
Added a directory called php and now I have 503 errors for everything...
EDIT 2
I deleted the php directory, now the 503 errors are gone. However, I do still get 404 errors for the subdirectory.
Here is my directory tree: http://pastebin.com/hzPCsCua
And I do use git to deploy my project.
php is one of the alternate document roots that you can use, please see the March Release blog post here about this (https://www.openshift.com/blogs/openshift-online-march-2014-release-blog)
As for the sub-directories not working, can you ssh into your server and use the "tree" command to post the directory/file structure of your project? Also are you using Git to deploy your project or editing files directly on the server?
You need to have an index.php or index.html file in any directory that you want to work like app-domain.rhcloud.com/sites , if you just have sub-directories, how would it know what to show? Also, indexing (showing a folders contents) is not enabled for security reasons, and I believe there is no way to enable it.
This sounds like it could be a problem with how you are serving your static content.
I recently created a new sample app for OpenShift that includes:
a basic static folder
an .htaccess file (for serving assets in production)
support for using php's local server to handle the static content (in your dev environments)
Composer and Silex - a great starting point for most new PHP apps
You can serve the project locally if you have PHP-5.4 (or better), available in your dev environment:
php -S localhost:8080 -t static app.php
For a more advanced project that is built on the same foundation, take a look at this PHP+MongoDB mapping example. I wrote up a blog post with some notes on my process for composing that app as well.
Hope these examples help!