Already logged in via netlify config on your machine
Run netlify status for account details
To see all available commands run: netlify help
netlify init
? What would you like to do? + Create & configure a new site
? Team: Redis
Choose a unique site name (e.g. super-cool-site-by-redisdeveloper.netlify.app) or leave it blank for a random name. You can update the site name later.
? Site name (optional): undefined
Site Created
Admin URL: https://app.netlify.com/sites/super-cool-site-by-redisdeveloper
URL: https://super-cool-site-by-redisdeveloper.netlify.app
Site ID: a70bcfb7-b7b1-4fdd-be8b-5eb3b5dbd404
Linked to super-cool-site-by-redis-developer in /Users/redisdeveloper/projects/netlify/basic-caching-demo-nodejs/.netlify/state.json
? Your build command (hugo build/yarn run build/etc): yarn start
? Directory to deploy (blank for current dir): dist
? Netlify functions folder: functions
Adding deploy key to repository...
Deploy key added!
Creating Netlify GitHub Notification Hooks...
Netlify Notification Hooks configured!
Success! Netlify CI/CD Configured!
This site is now configured to automatically deploy from github branches & pull requests
Next steps:
git push Push to your git repository to trigger new site builds
netlify open Open the Netlify admin URL of your site
Netlify 是一个流行的静态站点托管无服务器平台。它是以更可扩展和安全的方式构建、部署和扩展现代 Web 应用程序的流行方式。
Netlify 帮助开发人员在几分钟内轻松启动网站和活动。Netlify 主要为 JAMstack 网站构建,JAMstack 网站将 JavaScript 和 API 统一起来,以允许适合开发人员和内容编辑人员的应用程序。
在本教程中,您将了解如何在 5 分钟内将使用 Next.js 和 TailwindCSS 构建的简单 Redis 缓存应用程序部署到 Netlify。
访问 https://redis.ac.cn/try-free 创建免费的 Redis Cloud 帐户。在您创建 Redis Enterprise Cloud 数据库时,启用“RediSearch”模块。您将看到一个数据库端点 URL 和密码。保存它以备将来参考。
Netlify 的命令行界面 (CLI) 允许您直接从命令行配置持续部署。运行以下命令在本地笔记本电脑上安装 Netlify CLI
通过运行以下命令验证 Netlify 是否已安装:
要使用命令行进行身份验证并获取访问令牌,请运行以下命令登录您的 Netlify 帐户
这将打开一个浏览器窗口,要求您使用 Netlify 登录并授予 Netlify CLI 访问权限。身份验证后,它将要求您关闭窗口并显示以下结果
该 netlify init
命令允许您为新站点或现有站点配置持续部署。它还将允许您在不存在的情况下创建 netlify.toml 文件。
以上步骤将创建一个 netlify.toml
文件,其内容如下
按照 Netlify 的说明,运行以下命令将最新更改推送到 GitHub
单击“触发部署”以部署站点
单击部署 URL,您应该能够访问应用程序,如所示
npm install netlify-cli -g
netlify version
netlify-cli/8.15.3 darwin-x64 node-v14.17.3
git clone https://github.com/redis-developer/nextjs-redis-netlify
netlify login
[build]
command = "npm run build"
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"
git add .
git commit -m “Pushing the latest changes”
git push
netlify open --admin