What you will need for this tutorial
Imagine You've spend days, weeks or even months developing game of your dreams. And today you have published it to your server to share with people around the world and maybe to earn some money. Everything seems perfect. You get hundreds of plays everyday, money flows, You are happy. But after few days you start to see your game on other websites. They took your game without permission and now they having all of your money as well.
Your game plays on your server starts dropping. Hundreds becomes dozens... Then few... And then it stops. Money ends, You become bankrupt. Your wife leaves you, bank is taking your house. You die alone, homeless under the bridge...
Unfortunately that is a very sad true, well maybe not all of that but in most part ;)
HTML5 games are very hard to secure. And if I say impossible I don't think it would be a lie.
Everyone can access your image assets or even source code using any internet browser.
Construct 2 is doing great job to secure your source code with minification. But it only makes extremely difficult to reverse-engineer your project and do not protect from stealing your entire game and upload it somewhere else.
There are few methods to make sure your game will be playable only from your website and I will show you here one very simple way of doing that.