Hey everyone! I'm in the process of creating a self-hosted blog and have set up NodeJS with ExpressJS and MongoDB. However, I'm facing some dilemmas on how to implement the front-end and back-end efficiently. Currently, my server connects to the database for each GET request, fetches the data, then disconnects. My blog posts contain details like the title, author, content, tags, and dates, which I need to convert to human-readable formats. I haven't started on the front-end yet since I want to finalize my back-end first to avoid inefficient setups. My hosting load won't be high, but I want to get it right the first time.
I plan to have three key HTML pages: a homepage for the latest posts, a search results page, and an individual post page. I'm querying the server with JavaScript to get the data, and I'm wondering about several aspects:
1. Is it better to keep a persistent connection to the database or connect for each request?
2. Am I on the right track with MongoDB, or is there a better database solution for my needs?
3. I prefer to control the database interactions without allowing direct front-end queries. Is this a solid approach?
4. Should I stick with NodeJS, or is there a more efficient language or framework out there?
5. Lastly, how can I better handle displaying images and other elements in post content?
Thanks for any suggestions or insights you might have!
0 Answers
There is no answer to this question yet. If you know the answer or can offer some help, please use the form below.
Related Questions
Sports Team Randomizer
10 Uses For An Old Smartphone
Midjourney Launches An Exciting New Feature for Their Image AI
ShortlyAI Review
Is Copytrack A Scam?
Getting 100 on Pagespeed Insights for Mobile is Impossible