|
Post by account_disabled on Jan 27, 2024 23:17:17 GMT -8
Meteor是一个流行的全栈 Web 框架,可以非常轻松地构建您的想法原型并快速从开发到生产。它的反应性质和DDP的使用,使其成为构建简单的多人浏览器游戏的绝佳选择。 在本教程中,我将向您展示如何使用 Meteor 构建多人TicTacToe ,并使用其默认的前端模板引擎Blaze。我假设您已经使用过 Meteor 一些,当然,您对使用 JavaScript 进行编码感到很舒服。 如果您对 Meteor 的经验为零,我建议您首先按照Meteor 官方网站上的TODO 应用程序教程进行操作。 您可以在随附的 GitHub 存储库中找到已完成应用程序的代码。 创建应用程序 Learn to Code with JavaScript 如果您没有安装 Meteor,您应该根据您的操作系统按照其网站上的说明进行操作。 生成脚手架 现在安装了 Meteor,打开终端并运行以下命令: meteor create TicTacToe-Tutorial 这将创建一个包含您的应用程序名称的文件夹(在本例中为TicTacToe-Tutorial)。 这个新文件夹包含应用程序的基本文件结构。里面实际上有一个示例应用程序。请记住,这些价格适用于服务器部署,而不是针对 ServerPilot 的每个帐户。 Coach 具有更多功能,例如通过 LetsEncrypt 提供的免费 SSL、服务器健康统计数据等。Business 包更像是一个 WhatsApp 号码数据 迷你 NewRelic 或应用程序性能监控服务。您可以查看缓慢的脚本请求、应用程序资源统计信息等。 当然,免费套餐已经足够好了,但与教练和商务选项相比有限。 连接服务器 这感觉和 RunCloud 很相似。您还需要一个新的 Ubuntu 16.04 VPS 服务器才能启动。如果您有服务器的 root 密码,则无需通过 SSH 复制并粘贴安装程序命令。您可以输入您的服务器 IP 地址和 root 密码,ServerPilot 将在几分钟内准备好您的服务器。 但是,如果您不想在 ServerPilot 中输入服务器的 root 密码,那么您可以选择不这样做。您可以获取安装运行命令,然后通过 SSH 将其复制并粘贴到您的服务器中。 连接 ServerPilot.io 上的服务器 老实说,服务器部署过程感觉非常顺利和快速。 我希望看到的另一件事是从 GitHub 部署我的应用程序的方法。我找不到那个。我从文档中发现,如果我想通过 Git 部署我的脚本,我仍然必须通过 SSH 来完成。 调度或 crontab 也是如此。如果您熟悉CPanel,您会希望将调度内置到ServerPilot的Web面板中。不幸的是,事实并非如此。不过,您仍然可以通过 SSH 管理自己的 crontab。 ServerPilot.io 中的应用程序设置 Laravel 锻造厂 Laravel 锻造厂 不幸的是,如果您只是想尝试一下,则没有免费级别的帐户。我对此感到惊讶。完成后,我被重定向到立即创建一个应用程序。在这里,App就像虚拟主机。完成后,可以选择安装 WordPress。我想我应该尝试一下。如果需要,您还可以选择 PHP 版本。我选择了 PHP 7.1。 在 ServerPilot.io 上创建应用程序 管理您的服务器 从注册到部署服务器并启动并运行,体验非常好且快速。您很快就可以运行服务器。 当 (如 Joomla 和 Concrete5)也可用。不幸的是,它们不存在,并且 ServerPilot.io 也没有提供设置 Web 根目录除 之外的位置的选项/public。
|
|