banner
MACSITE

@MACSITE

兴趣是学习的动力,学习也能成为消遣!--你愁啥-ncs.fun

Messing around with Qexo, the backend application for Hexo.

Setting up the backend application for qexo, hexo#

Brief Introduction#

After setting up the hexo blog system, I found that there is no backend and can only publish articles through the command line.

Then I tested many backend programs, which is really troublesome for bloggers who have not used hexo before.

By chance, I came across qexo, which supports WYSIWYG markdown.

It's a blessing for beginners, but the instructions written by the author of qexo are too brief for beginners. I had to repeatedly search for information and tutorials.

There are few online tutorials, and I finally managed to set up qexo by piecing together information from various sources.

Why didn't I deploy it locally? Well, first, I'm lazy, and second, it's really too cumbersome and full of pitfalls.

Important: All hexo settings rely on code modification.

If you don't want to go through all the trouble, I suggest using Z-Blog or WordPress.

Now there is a new option, which is the blog you are currently reading, provided by xlog.

Let's talk about the website required to set up qexo#

1. MongoDB#

Why use it... because it's free. SupaBase database is also free, but when deploying qexo, I encountered a 500 error with an all-English message, so I gave up.

MongoDB worked on the first try.

Register for a MongoDB account and create a free MongoDB database. Make sure to choose AWS / N. Virginia (us-east-1) as the region. On the Clusters page, click CONNECT and follow the steps to allow connections from all IP addresses. Create a database user and record the database connection information. The password will be the value you set.

image

This is the official website's brief explanation. Isn't it too brief? I had to search for the registration method and database creation for MongoDB.

2. One-click deployment https://vercel.com/#

Here is the official introduction, but it's not really for beginners. At least you need to have some basic knowledge. If you don't, I suggest you give up here. Unless you enjoy tinkering.

Continue searching https://vercel.com/ to register. Also, note that the free domain of vercel.com has been contaminated (I don't know why it's contaminated, it's just what I found online, I'm not responsible for it), and it cannot be used in China. You need to bind your own domain, which is a pit. Pay attention if you're a beginner.

But I think the interface and operation of Vercel are more user-friendly than Netlify, and the most important thing is that Vercel is free. I haven't figured out Netlify yet!

One-click Deployment##

Deploy to Vercel

The first deployment will throw an error. Please ignore it and re-enter the project. In the project settings interface, add environment variables.

NameMeaningExample
MONGODB_HOSTMongoDB database connection addressmongodb+srv://cluster0.xxxx.mongodb.net
MONGODB_PORTMongoDB database communication port27017
MONGODB_USERMongoDB database usernameabudu
MONGODB_DBMongoDB database nameCluster0
MONGODB_PASSMongoDB database passwordpassword

Click Redeploy in Deployments to start the deployment. If there are no error messages, you can open the domain and enter the initialization guide.

This is just the end of qexo deployment#

There is also hexo deployment, but I won't explain how I did it. At least you are familiar with GitHub if you can see this. If you're not familiar, search for it. At least it's a learning process. I'll talk about hexo next time.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.