当前位置:网站首页>Host your own website with Vercel

Host your own website with Vercel

2022-08-02 04:36:00 GentleTK

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, make sure you have Git and Node.js installed before using Vercel.

1 Sign up and install

First go to Vercel official website to register an account, now registering new users must use GitHub, GitLab or BitBucket account to authorize and bind the mobile phone number. After registration, you can modify your email address on the configuration page.

# Install Vercelnpm i -g vercel# Log in to Vercel, vc is the abbreviation of Vercel, you can also use Vercel insteadvc login YourEmailAddress

Vercel will send an email to your mailbox, after confirmation, you can log in:

Vercel confirmation email

Login Vercel

2 Publish your website/project

# Post site/projectvc --prod

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

Synthetic big watermelon game

After publishing, you will get two URLs, just open one and you can enter the game, but this URL does not look particularly elegant. If you have a domain name, you may wish to set it up with me.

Synthetic large watermelon URL 1

Synthetic large watermelon URL 2

3 Bind your domain name

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

# Bind your own domain namevc domains add YourDomains

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

Bind your own domain name

According to the prompt information, Vercel let 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:

# Method 1@ A 76.76.21.21# Method 2ns1.vercel-dns.comns2.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 to use the vc --prod command on the terminal to publish it again:

Release synthetic watermelon application

I found that I can access Synthetic Big Watermelon through my own domain name.

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

原网站

版权声明
本文为[GentleTK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020323580089.html