Host your own website with Vercel

Whether you want to have a blog of your own, or you want to publish your own small project to the outside world for everyone to access, Vercel is definitely an affordable option.

Note, before using Vercel make sure you have installed Gitand Node.js.

1 Register and install

First, go to Vercel's official website to register an account. Now, to register a new user, you must use GitHubthe GitLabor BitBucketaccount for authorization and bind the mobile phone number. After the registration is complete, you can modify your email address on the configuration page.

# 安装Vercel
npm i -g vercel

# 登陆Vercel,vc是Vercel的简写,也可使用Vercel代替
vc login YourEmailAddress

VercelAn email will be sent to your mailbox, after confirmation you can log in:

Vercel confirmation email

Login to Vercel

2 Publish your website/project

# 发布网站/项目
vc --prod

The project configuration is basically all the way to enter. My project here is a small game for synthesizing a big watermelon:

Synthetic big watermelon game

After the release, you will get two URLs, just open one to enter the game, but this URL does not look particularly elegant. If you have a domain name, you might as well set it up with me.

Synthetic large watermelon URL 1

Synthetic large watermelon website 2

3 Bind your domain name

If you have a domain name, you can bind it to Vercel:

# 绑定自己的域名
vc domains add YourDomains

After running the command, you may be prompted for a project name (my project name is here daxigua):

Bind your own domain name

According to the prompt information, Vercellet us change the server address of DNS resolution and send an email to us. According to the email prompt, there are two ways to achieve the goal:

# 方法一
@ A 76.76.21.21
# 方法二
ns1.vercel-dns.com
ns2.vercel-dns.com

I directly choose the first one here. First, enter the console where the domain name is purchased, then find the DNS resolution service, and add a record set:

Add recordset

After the configuration is complete, you will receive an email prompting you vc --prodto issue it again using the command in the terminal:

Release the application of synthetic large watermelon

I found that I can access the synthetic big watermelon through my own domain name .

Article author: GentleTK
Original link: https://gentletk.gitee.io/ Host your own website with Vercel

Guess you like

Origin blog.csdn.net/qq_40531408/article/details/126070269