Blog 11-22-21

Create a  MongoDB account and choose Shared Cluster (Free)

/images/log1/blog11-22-21/shared_cluster.png

The recommended region is AWS / N. Virginia (us-east-1)

/images/log1/blog11-22-21/connect_to_cluster_0.png
  1. Add a connection IP address: Allow access from anywhere ➡️ click Add IP Address

  2. Create a Database User with a username and password. Keep it safe somewhere.

/images/log1/blog11-22-21/choose_connect_method.png

After that, go to next step. ❤️

/images/log1/blog11-22-21/choose_connect_method2.png

Choose Connect your application

Copy the code in Add your connection string into your application code, starting with mongodb+srv://

Replace password with the password for username. Replace myFirstDatabase with the name of the database that connections will use by default.

  1. Register an account at Vercel

  2. Click the link below to deploy Twikoo to Vercel with one click:

➡️  Deploy

Create Git Repository: enter a Repository Name

Enter Settings-Environment Variables, add the environment variable MONGODB_URI, the value is the database connection string (see above)

Press Redeploy.

Navigate to Overview and click on the link under Domains. If the environment is configured correctly, you can see the prompt “Twikoo cloud function is operating normally” (“云函数运行正常”)

Vercel Domains (including the https:// prefix, such as https://xxx.vercel.app) is your environment id for Twikoo

Notice

In case of error like URI does not have hostname, domain name and tld

Go to the database, click edit password and generate a new password, give only characters and numbers.

 Twikoo Docs