May 27, 2021 Web Cloud Development and Web Hosting Learning Guide
As big apps launch their own small game platforms, games are getting more and more attention from developers.
Cocos Creator is a complete game development solution that includes a lightweight and efficient cross-platform gaming engine, as well as the graphical interface tools you need to develop your game faster. This article describes how to quickly deploy Cocos Creator's game code online through static hosting of cloud development sites.
The focus of this article is not on how to develop a game with Cocos Creator, so if you don't have cocos Creator usage or development experience, it's recommended to consult Cocos Creator's development manual first.
Assuming that we've now developed a Cocos Creator game, click
Cocos Creator -> 项目 -> 构建发布
the project - build the release and you'll see the following interface:
Click Build to compile our developed game into an accessible web game project structure:
Here we choose Web Mobile as we need to access our games again
发布平台
web side, so in the options forWeb Mobile
We went to Tencent Cloud's cloudbase console and chose to launch a cloud environment:
Note here that the selection is a metered model (static site hosting can only be opened on a metered bill). Once created, click into the cloud environment we just created and enter the cloud environment management interface:
In the cloud environment management interface, in the site hosting on the right, we can upload the static pages that have just been generated in the project. Of course, manual uploads are not very friendly, and we can also use cloudbase cli to perform the upload as a command line.
First, install the cloudbase cli:
npm install -g @cloudbase/cli
To execute a login command:
tcb login
Confirm authorization on the pop-up page:
Next, in the project, the
build/web-mobile
directory files are deployed:
cloudbase hosting:deploy ./build/web-mobile -e EndId
The EnvID here is replaced by the environment ID you just created.
Static websites developed by Tencent Cloud cloud host the default domain name to access:
With the default domain name, we can access it.
We'll be able to access it. However, it is important to note here that cloud development static hosted default access domain name limits the down-line speed of access, for the game such a large amount of static resources, it is recommended to buy their own domain name binding access.