I already have a wordpress website. I studied web development using js, node.js, express and mongodb and build some projects. I would like to add it to my website. Is this possible or I just need to create a website without wordpress and add my projects?
2
Answers
Your best bet is to build another web site with a different host name. WordPress uses a venerable scheme called mod_rewrite where nodejs uses route handlers to make sense of paths. Paths are the
/section/page
parts of urls likehttps://example.com/section/page
. It will be challenging, to say the least, to integrate those two ways of handling paths.WordPress has its own rest API you can use WordPress API and a frontend framework like Vuejs or React to interact with WordPress, actually, WordPress is your backend, and the frontend framework is your frontend look at the example below:
https://52hertzcouture.com/
https://backend.52hertzcouture.com/wp-login.php
about nodejs there are some packages like node-wpapi that can help you to
connect to wordpress rest api with nodejs as a client and do everything a
client can do, for example make posts, make pages, etc.
check out link below:
https://github.com/WP-API/node-wpapi
i think using wordpress as backend and a frontend framework like vuejs as
frontend is a good idea if you want to use wordpress and extend your
website.