How to code a BLOG in VueJS & NodeJS - Server API - Day 28 - #100DaysOfCode

preview_player
Показать описание
MORE NODEJS! In this video, we use NodeJS to create an API for our VueJS blog. We use Mongoose for its powerful MongoDB functionality to store data in the database.

My Text Editor: VSCode
My Theme: Google Material

Go check out our discord community…

Follow me on Twitter for upload updates…

Thanks for watching!

If you enjoyed, leave a like.
If you want more, subscribe.
If you have any feedback, drop it in the comments!

#100DaysOfCode #100DaysOfCodeChallenge
Рекомендации по теме
Комментарии
Автор

Who's ready for the VueJS part of the video tomorrow? 🙌

TylerPotts
Автор

I subscribed first before I watch, , depending on how your pieces of stuff are so clean, I hope to learn a lot from you.

mreddygi
Автор

thanks for this man, im trying to learn node from php background. please continue this one you are helping a lot of people

spectreross
Автор

i see animes content with vue js
i didn't think when i subscribed
great content !

MourideGoor
Автор

Really helped and make me learn with node

javascriptpoint
Автор

As for the API itself, it might be a good idea to keep to the REST endpoints.

You use the core route for each model, like /api/posts
Then you use the different request methods to determine what is happening.

POST /api/posts will create a new post
GET /api/posts will get all posts
GET /api/posts/{id} will get a specific post by ID
PUT /api/posts/{id} will update a specific post by ID
DELETE /api/posts/{id} will delete a specific post by ID

That makes the API a lot cleaner, both to write and use. For example, you could use a model's root route as a variable.
const routePosts = "/api/posts"
app.get(routePosts, (req, res) => { //get all posts })
app.post(routePosts, (req, res) => { //create a post })
etc. etc..

morphman
Автор

Postman has gone the "paid licence" route, well it has a free version but most features are stripped out. It is well worth the price, but if you want an alternative, Insomnia still has a free version.
Great, if you're not planning on earning a lot from what you're doing and want to keep overheads down.

If you're planning on something more major, like a straight-up commercial application, paying for the full licence, either on Postman or Insomnia, is well worth it. On higher tiers for both applications, you get multi-user access and user access control tools, great for collaborations.

morphman
Автор

Hey, what font are you using on your command lne ?

thabo
Автор

Hey Tyler.. i really love your tutorials.. keep it up. Pls how can i do this same set up in nuxtjs. I really want to know how to add express and mongo db to Nuxt js project

PeterAkaliro
Автор

To get the newly updated post, add the option "new = true" to the PostModel request.
PostModel.findByIdAndUpdate(id,  payload,  {new: true},  (err,  result) => {

morphman
join shbcf.ru