Skip to content

Commit 7604b7d

Browse files
committed
Web bridge
1 parent 57ddd77 commit 7604b7d

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

_data/authors.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ arcadio:
44
twitter: arcadio_g_s
55
silvia:
66
name: Silvia Barbero
7-
pic: https://avatars0.githubusercontent.com/u/9416356?v=3&s=460
7+
pic: https://avatars2.githubusercontent.com/u/7422374?v=3&s=460
88
twitter: SilviShinyStar

_posts/2017-7-2-webBridge.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
layout: post
3+
title: "Web Bridge"
4+
date: 2017-7-2 19:49:11 +0200
5+
author: silvia
6+
categories: bridges web
7+
heropic: /pictures/azureweb.PNG
8+
---
9+
10+
11+
To allow developers to publish their games in different platforms, Clockwork offers a set of bridges, programs that will export Clockwork games (.cw) to native apps. One of these is the Web Bridge, which generates websites that host the games so they can be played in any browser. To use it you just need to upload your .cw package generated by Clockwork Runtime.
12+
13+
###Generating the web
14+
In order to use this bridge, open your game's folder in Visual Studio Code and press F1 and write `Export game using the Web Bridge`. Clockwork will then create a folder named `web` for you. Inside it, you will find everything needed to host your game in a website.
15+
If you want to give it a try locally you might want to create a fast local server. You can do this with Node.js very easily. Install [Node.js](https://nodejs.org/en/) and then use npm to install [http-server](https://www.npmjs.com/package/http-server). Open cmd in the folder where you want to test it (the web folder here, where the index is) and run `http-server`. Now open a browser and go to `localhost:8080` and your game will be there.
16+
17+
###Hosting your game in Azure
18+
Now you probably want to host that web somewhere. We do it with Microsoft Azure. You can get Azure through Visual Studio Dev Essentials (`https://azure.microsoft.com/en-us/pricing/member-offers/vs-dev-essentials/`) or Dreamspark if you are a student (`https://azure.microsoft.com/en-us/pricing/member-offers/imagine/?cdn=disable`).
19+
20+
When you have Azure, open the portal at `portal.azure.com` and create a new Web App by clicking `New` at the left menu and selecting Web + Mobile > Web App. Give a name to your web for the URL and choose the subscription, resource group, OS, and service plan to use. If you don't know what to choose, just leave the defaults and create a new resource group with the name of your game. :) I also recommend to click the "Pin to dashboard" checkbox at the bottom right above the `Create` button so you can find it easily when using the Azure portal. Now click `Create`!
21+
22+
The website is now ready but it is still empty. You can visit it and see it tells you "Your App Service app has been created". To put your game inside this website you have a few methods available. I myself am a big fan of deploying from Github, or Onedrive for fast things, so I'll cover that.
23+
24+
25+
####Github deployment
26+
This method requires you to use Github, obviously. It isn't very complex though, so you might want to try it. From the overview of your new Web App, search for `Deployment options` in the left menu, click it and then click on `Choose Source`. Choose Github and Azure will ask you for your Github credentials. It will then ask you to choose a project from Github and a branch from which to deploy. It is a good practice to have a `dev` branch in your project to develope and leave the `master` branch for the deployment, committing to it only working versions. And that is all, it might take a few minutes to sync but, after that, you can check your website again and you'll see the game running!
27+
28+
29+
####Onedrive deployment
30+
This method can be a bit messy but it is easy and very fast. From the overview of your new Web App, search for `Deployment options` in the left menu, click it and then click on `Choose Source`. Choose Onedrive and most of the options will be already filled in. Azure will create a folder with the name of the web app in your Onedrive.
31+
32+
Go to Onedrive and you'll probably see a new folder named "Applications" and "Azure Web Apps" inside it. There you have the folder that will be synced. Fill it with the contents of the web folder created by Clockwork so that the index.html is in the root. Include there too [this Web.config file](https://gist.github.com/arcadiogarcia/90915843d14d53459148d77a630b93c0) that makes Azure allow json files.
33+
34+
Go back to the Azure portal and back to `Deployment options` and click on `Sync`. When that's ready, go visit your webpage again and the game will be running!

pictures/azureweb.PNG

60.1 KB
Loading

0 commit comments

Comments
 (0)