silverup

Phaser-Visual Studio-TypeScript Deployment

Recommended Posts

Hello ,

I'm super new to Typescript , html5 , and I'm looking for some direction, so I started my first "hello world" game and I would like to know how to host it(web host). I have windows hosting through Arvixe... not sure what is required

 

I'm using visual studio 2015 and typescript

 

Thank you in advance 

 

Jimmy

Share this post


Link to post
Share on other sites

There are lots of ways to achieve this sort of thing, and plenty of services out there that can take care of all the heavy lifting of setting up a box to serve your stuff (for a price).

One relatively simple cost-effective way (if you don't mind getting your hands dirty):

* Buy yourself a virtual machine from any hosting provider (Amazon, Rackspace, Azure etc are amongst the biggest providers, cheaper solutions I've used include DigitalOcean, Linode and Vultr, but there are quite literally thousands of them, all much of a muchness)

* Follow guides from the provider about basic set up for the box (each will have these guides, I found DigitalOcean docs very very high quality)

* If you're hosting a JS-powered client-side only game then all you have to do is set something up to serve these files to the client for you, you do not need anything smart

* Nginx, varnish or apache can handle this requirement very easily

* Follow guides for setting up any of the above

* If you bought a domain name then set that up to point at the ip of the box you just set up (again, follow guides by the provider if unsure, many providers will also provide a DNS service for you to buy domains if you wish)

* What you'll generally end up with is a service (nginx, varnish etc) serving requests from yourdomain.com from a specific folder on the box, scp your files in to this folder and hit the url in the browser to check it

This is a very simple way of doing things and doesn't require too much effort. Note that you don't have any explicit monitoring or maintenance set up like this, nor do you have anything smart like a CI/CD solution in place, nor any kind of load-balancing etc etc so don't expect to be serving thousands of requests per minute but you might be surprised at how far you get. When you need to upscale you're presumably making some money out of it and can afford to invest in a more robust solution, you may never need to do this.

If even this sounds like too much work then many services will do this for you and set up basic monitoring. This is generally a little more expensive but easier, all you'd have to do is copy your files on to the box (or they may even provide some sort of web portal for uploading your files).

Share this post


Link to post
Share on other sites

If you want to use free hostings you can create a hosting on https://github.com/ or https://bitbucket.org/ You need to call them: your-nick-name.github.io and your-nick-name.bitbucket.io But it is for games without database and multiplayer. If you need a database you can use https://firebase.google.com/ or heroku.com On heroku.com you can create 5 apps for free with multiplayer in Node.js + Socket.io or WebSockets 

You can create only one hosting on https://github.com/ or https://bitbucket.org/ But you can create folders for your games like this:

- snake
-- index.html
-- bundle.js
-- images
--- background.png
--- cell.png

- arkanoid
-- index.html
-- bundle.js
-- images
--- background.png

How to create bundle.js you can see here: Advanced Phaser and TypeScript Projects

Share this post


Link to post
Share on other sites

You can use Visual Studio Code + Gulp to create compressed bundle.js file from TypeScript files for deploying. All files for deploying will be in "public" (or "dist"/"build") directory.

Some examples in TypeScript + VSCode + Gulp: https://github.com/8Observer8/phaser-tutorial-examples-in-typescript

How to run these examples:

  • install: VSCode, Node.js
  • npm install http-server -g
  • cd phaser-tutorial-examples-in-typescript-master
  • npm install
  • cd advanced-phaser 
  • gulp
  • cd public
  • http-server
  • go to browser and type: localhost:8080

You can run them from here:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.