Planning & First Steps | Creating a REST API with Node.js

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2017
  • Time to dive into it! Let's start building our Node RESTful API. Well actually, let's quickly plan it before we start.
    🖥️ Official Website & Courses
    academind.com/courses/
    👨‍💻 Full Node.js Course
    acad.link/nodejs
    👋 Social Media
    / maxedapps
    / academind_real
    / academind_real
    / academindchannel
    💬 Academind Community on Discord
    / discord
    ----------
    Academind is your source for online education in the areas of web development, frontend web development, backend web development, programming, coding and data science! No matter if you are looking for a tutorial, a course, a crash course, an introduction, an online tutorial or any related video, we try our best to offer you the content you are looking for. Our topics include Angular, React, Vue, Html, CSS, JavaScript, TypeScript, Redux, Nuxt.js, RxJs, Bootstrap, Laravel, Node.js, Progressive Web Apps (PWA), Ionic, React Native, Regular Expressions (RegEx), Stencil, Power BI, Amazon Web Services (AWS), Firebase or other topics, make sure to have a look at this channel or at academind.com to find the learning resource of your choice!

ความคิดเห็น • 260

  • @Kjata316
    @Kjata316 4 ปีที่แล้ว +4

    THANK YOU for this! Very helpful!

  • @justTas_
    @justTas_ 3 ปีที่แล้ว +1

    Max has been teaching me to be a better developer for three years now! Let's goooo! 😊😊😊😊😊

  • @michaelliriano5027
    @michaelliriano5027 3 ปีที่แล้ว

    Best nodejs walkthrough on TH-cam

  • @sadmanchowdhury4165
    @sadmanchowdhury4165 3 ปีที่แล้ว

    thank you
    Academind
    for this part

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 ปีที่แล้ว +8

    Thank you for this awesome series and also make social network website like Facebook with nodejs, express, mongodb. I every day waiting for your video's

  • @michaelffasd23
    @michaelffasd23 6 ปีที่แล้ว +2

    Excellent tutorial, great for anyone starting out with REST API!

    • @academind
      @academind  6 ปีที่แล้ว

      Thank you so much for your comment Michael!

  • @ArmandoBN497
    @ArmandoBN497 4 ปีที่แล้ว +4

    You are awesome! Have made me understand this finally! Keep up the awesome work this really means a lot to me, being able to understand all of this

  • @MrAuro
    @MrAuro 3 ปีที่แล้ว +18

    I almost never comment on tutorials, but this was a really good tutorial. It was short and I feel like I actually learned things instead of just copying code. 👍

    • @DJCreeperNo1
      @DJCreeperNo1 2 ปีที่แล้ว

      can confirm,
      i'm working on a site and the front-end was somewhat easy,
      the backend is a nightmare for my mind,
      this really cleared some misunderstanding "hooks" that i had for express JS

  • @simonty1811
    @simonty1811 5 ปีที่แล้ว +4

    thankyou for this serious

  • @BudiSantoso-er6cq
    @BudiSantoso-er6cq 5 ปีที่แล้ว

    Nice Tutorial, thanks..God Bless You..

  • @nileshkharat1188
    @nileshkharat1188 3 ปีที่แล้ว +1

    mind blowing man, the best tutorial on the youtube platform, beginners and experience both required a explanation like you, hats of you man.... MAX you are a legend. Thanks a lot for this tutorial

  • @oilcanbland
    @oilcanbland 4 ปีที่แล้ว +9

    Max, I love you man! Been taking your courses for a couple years now. As of Feb 2020, is this serious still still wiable and up to date? Thanks dude!

  • @jojojawjaw
    @jojojawjaw 5 ปีที่แล้ว +1

    Thanks a lot. You're the best.

  • @dmytro.turskyi
    @dmytro.turskyi 7 หลายเดือนก่อน +1

    Hi Maximilian, thank you for the informative video on creating a REST API with Node.js. I found your explanations and step-by-step process really helpful.
    I noticed that you used pure JavaScript for your backend application. I was wondering what your thoughts were on using TypeScript instead. TypeScript has some great benefits like static typing and improved code maintainability. Was there a specific reason why you chose not to use TypeScript in this particular project?
    I'd love to hear your perspective on this. Thanks again for sharing your knowledge through these videos!

  • @alexnezhynsky9707
    @alexnezhynsky9707 6 ปีที่แล้ว +4

    Getting closer and closer to 100k subs! Great job, Max! 👍 Awesome content and presentation. Love your channel!

    • @academind
      @academind  6 ปีที่แล้ว +3

      That's indeed so awesome Alex, I'm so happy to see how the channels keeps growing thanks to all of you guys! Also thanks a lot for your amazing feedback :)

  • @abdulrahamanolatunde6548
    @abdulrahamanolatunde6548 7 หลายเดือนก่อน +2

    Hi Maximilian, thank you for all the knowledge you have being pouring out. This is the second programming language I will be learning with your materials. The first one was from Udemy and I really enjoyed it.
    Talking of PHP, I'll like to ask if you have a PHP course for building Restful APIs. If yes, please share the link as I've looked around for it and can't find it. If no, do you have plans of making one soon?

  • @mj25423
    @mj25423 4 ปีที่แล้ว +3

    You are amazing. Thanks a lot for the tutorials, it is so so simple explanation and the first time without any hiccups something works without set up issues!

    • @academind
      @academind  4 ปีที่แล้ว

      Happy to read that, thanks a lot!

  • @arshamazami159
    @arshamazami159 3 ปีที่แล้ว

    Thank you for your useful courses thank you 😊

  • @manmohangupta6905
    @manmohangupta6905 6 ปีที่แล้ว

    Sir you are really great I have ever seen such type of teaching way like you thanks so much for making people happy and evolve the world using technology .
    I am from india and u are really great thanks so much again and namaste ..

    • @academind
      @academind  6 ปีที่แล้ว

      Thank you so much Manmohan, that's just amazing to hear! :)

  • @Shree79124
    @Shree79124 6 ปีที่แล้ว

    Great man.. Now I finally decided to create API's with NodeJS .

    • @academind
      @academind  6 ปีที่แล้ว

      Awesome! Thanks for your great feedback Sachin!

  • @ambyudo6958
    @ambyudo6958 6 ปีที่แล้ว

    Thank you for your tutorial, how can we implement NodeJS- base API which will give the results of an SNMP poll of a remote server, having snMp community string, snmp OID1 and snmp OID2, remote server IP any address with port 161, Thanks

  • @icitywork7731
    @icitywork7731 6 ปีที่แล้ว

    Keep them coming, can 't wait for the next one :)

    • @academind
      @academind  6 ปีที่แล้ว +1

      Awesome to read that you like the series, next part coming soon!

  • @mohamedyassinekhlif
    @mohamedyassinekhlif 4 ปีที่แล้ว +1

    Keep up the good work dude ;)

  • @israelruas948
    @israelruas948 3 หลายเดือนก่อน

    Thank you so much for all your help.

  • @lightlover78
    @lightlover78 4 ปีที่แล้ว

    Thank you!

  • @ezzoubeirelasraoui7839
    @ezzoubeirelasraoui7839 4 ปีที่แล้ว

    Thank you so much sir !!!!!

  • @jerrysmith3014
    @jerrysmith3014 4 ปีที่แล้ว

    Max awesome content! I'm researching a Reference error: Process is not define. I'm researching this but the documentation is not clear to me. Any Help is received with gratitude.

  • @hammadkhan2874
    @hammadkhan2874 3 ปีที่แล้ว

    For best tutorial on node js watch w3 Grads:
    th-cam.com/video/wefZImC7vn4/w-d-xo.html
    th-cam.com/video/iHQXkxiwi3Q/w-d-xo.html

  • @tarasenkoalexander4607
    @tarasenkoalexander4607 5 ปีที่แล้ว +5

    For newcomers: You can use
    server.use(app); // app is imported from app.js
    server.listen(8000, () => {
    console.log('App is listening on port 8000!')
    });

    • @shwetadubey9238
      @shwetadubey9238 4 ปีที่แล้ว

      can you tell me what is the differnce beween this code and Max sir coe because i am in newcomers in node js

    • @shwetadubey9238
      @shwetadubey9238 4 ปีที่แล้ว

      Thnku but this code worked it

  • @bloxzyo
    @bloxzyo 2 ปีที่แล้ว +4

    Why does he use both express and http? Express is enough to get the job done in this video..... I am confused....

  • @fareed7753
    @fareed7753 2 ปีที่แล้ว

    A perfect teacher to learn any CS technology! Keep it up Man!

  • @leandrolavore4068
    @leandrolavore4068 5 ปีที่แล้ว

    Max, junge, by far the best tutorials around. I am over 30, never coded before, just got into it like three months ago and learning a lot. Owe you a big deal. Thanks a lot.

    • @academind
      @academind  5 ปีที่แล้ว

      Thanks so much Leandro, I wish you all the best on your programming journey :)

  • @LesJoee
    @LesJoee 6 ปีที่แล้ว

    that's helpful.thanks man you doing well

    • @academind
      @academind  6 ปีที่แล้ว

      Thank you so much for sharing this Jesse :)

  • @vinothkumarv9722
    @vinothkumarv9722 3 ปีที่แล้ว

    Bro you are great did well.. very good explanation.... love you brother. :)

  • @logicstv
    @logicstv 4 ปีที่แล้ว

    This setup of express server , is it something that shroud be perceived as intuitive or I should memorize the code?

  • @hamzajaved6110
    @hamzajaved6110 ปีที่แล้ว

    Thanks learn a lot from your vedio 😎 amazing bro

  • @isoplayers
    @isoplayers 5 ปีที่แล้ว

    I saw a SO post saying that "--save" is no longer needed because it automatically adds the dependency to package.json. For some reason, it doesn't work for me. So is it still needed?

  • @aiduongtran6653
    @aiduongtran6653 4 ปีที่แล้ว

    thanks a lot bro

  • @rotrose7531
    @rotrose7531 6 ปีที่แล้ว +1

    Thank you, it gives me what api is for the first time. Please create more and more enlightening tutorials like this.

    • @academind
      @academind  6 ปีที่แล้ว

      Thanks for your awesome feedback! I'll try my best!

  • @dragomirtachev5553
    @dragomirtachev5553 6 ปีที่แล้ว

    Love the way you show how things add up and they way they fit together

    • @academind
      @academind  6 ปีที่แล้ว +1

      Thank you, makes me really happy to read that you like my explanations!

  • @amikkaaski9107
    @amikkaaski9107 2 ปีที่แล้ว

    This video is the most apt to my project even after 4 years of its release. Just want to say thank you, to Academind!

  • @balajis456
    @balajis456 3 ปีที่แล้ว +2

    This is helpful, also purchased angular course on Udemy. Love your teaching style.

  • @shubhamdubey4691
    @shubhamdubey4691 5 ปีที่แล้ว +1

    I see Max , I like the video.

  • @SampathLokuge
    @SampathLokuge 6 ปีที่แล้ว

    Supper cool. Thanks a lot Max :)

    • @academind
      @academind  6 ปีที่แล้ว +1

      Thank YOU for your awesome feedback Sampath!

  • @jamesgarcia5221
    @jamesgarcia5221 4 ปีที่แล้ว

    Nice one, thank you

  • @nareshkollipora5323
    @nareshkollipora5323 3 ปีที่แล้ว

    Helpful Lecture

  • @UsamaKhan-um3nr
    @UsamaKhan-um3nr 6 ปีที่แล้ว +1

    your knowledge is awesome and also have neat and clean voice also good your explanation about any topics.
    thank you.

    • @academind
      @academind  6 ปีที่แล้ว

      Really great to read that Usama, thank you very much for your wonderful feedback :)

  • @ramithalasath8791
    @ramithalasath8791 3 ปีที่แล้ว

    Thank you very much for this tutorial series. It's very helpful and it's same as my project 😁

  • @elprincipito1704
    @elprincipito1704 5 ปีที่แล้ว

    Hello there!! I am trying ot create my restful Api resources using node js, howvere our compnay uses apache web server. Do i need to install Node js in our server? or can i just use the methods you are curently expaling and installl node js as a dependency in my project. Thanks! Tonathiu

  • @Andrey-il8rh
    @Andrey-il8rh 6 ปีที่แล้ว

    Max, did you think of using babel-watch inside the project? It allows using 'import' style syntax as well as all new but yet unsupported features of ES 2017

    • @academind
      @academind  6 ปีที่แล้ว +3

      I considered a more complex setup but decided against it to keep the project/videos focused on the core of the series, which of course is building the RESTful API itself

  • @sarimali8853
    @sarimali8853 4 ปีที่แล้ว

    Excellent 👌👍 brother

  • @ilgorxoja1910
    @ilgorxoja1910 ปีที่แล้ว

    thank you

  • @peekpt
    @peekpt 6 ปีที่แล้ว +2

    I use RESTFUL APIs on mobile apps but never ever built a restful server. I am learning from you. Also following your tip and learning Vue . I have a question: I'm having trouble in memorizing all the different programming languages syntax . I do C for micro controllers, swift for iOS, now javascript, including css html. How do you do it? what is your trick? Thank you Max.

  • @bashar042
    @bashar042 ปีที่แล้ว

    You are awesome!!

  • @noohusyed
    @noohusyed 6 ปีที่แล้ว

    I installed node express with sucess, in server.js im getting red squigly(sorry for spelling) under re in require('http'). Am i missing somethkng?
    Thanks

  • @Ecdetails
    @Ecdetails 5 ปีที่แล้ว

    Think about everything max does support him by getting his courses on udemy they are all amazing thanks for this tutorial

    • @academind
      @academind  5 ปีที่แล้ว

      Thanks so much for your great feedback and for your support here and on Udemy Eddie! This honestly means a lot to me!

  • @jayem3662
    @jayem3662 6 ปีที่แล้ว

    thank you for the tutorial.
    btw, is the server.js is necessary if I'm in react native for mobile dev and planning to use this tutorial? I mean, that "http" thing.
    please reply, I would appreciate so much. :)

    • @academind
      @academind  6 ปีที่แล้ว +1

      You need to spin up the Node.js server - the file can be named whatever you want though. But the content is important, yes

  • @mq101t
    @mq101t 6 ปีที่แล้ว +16

    thanks for this video is so cool,but way you make a server in native node and don't use express "app.listen(port ,function () {
    console.log('listening at ' + port);
    })"
    it just question ?
    and thanks again :)

    • @jakubrpawlowski
      @jakubrpawlowski 6 ปีที่แล้ว +2

      I always wondered about the same thing when watching last two express series on this channel. Why not just app.listen Max?

    • @academind
      @academind  6 ปีที่แล้ว +10

      Simply a habit - you can use both, that's absolutely true

    • @jakubrpawlowski
      @jakubrpawlowski 6 ปีที่แล้ว

      Thanks for a quick reply as always! Do you ever REST? :P

    • @Andrey-il8rh
      @Andrey-il8rh 6 ปีที่แล้ว

      Not really an efficient habit, though. I agree with other guys that this pattern feels odd

    • @jakubrpawlowski
      @jakubrpawlowski 6 ปีที่แล้ว

      Andrey Bogdanov actually I realized that if you want to have http, https and websockets all using one connection then you need to do it the http.createserver way :p

  • @michaelrandall6954
    @michaelrandall6954 3 ปีที่แล้ว

    Hello Max, I see that you are running this, I assume on a local machine. How would I deploy this to an azure resource. I have limited access to azure resources, but I was thinking that I could create a ubuntu linux vm and would I install apache and then bundle this code and put it in the http directory or would I install node on the linux box and then not sure of my options.

  • @shyarxelil1987
    @shyarxelil1987 4 ปีที่แล้ว +2

    Why dont you use express instead of using http module? For example you could just like so:
    const express = require('express')
    const app = express()
    const port = 3000
    app.get('/', (req, res) => res.send('Hello World!'))
    app.listen(port, () => console.log(`Example app listening on port ${port}!`))

  • @fmaransatto
    @fmaransatto 6 ปีที่แล้ว

    awesome!

  • @ManishYadav-qe6lk
    @ManishYadav-qe6lk 6 ปีที่แล้ว

    i am getting events.js:183 error can you help me and how to remove all ready used port

  • @suryachaturvedi5036
    @suryachaturvedi5036 5 ปีที่แล้ว +3

    not working. server is running but not showing on local host

  • @kurtke1990
    @kurtke1990 5 ปีที่แล้ว

    Does anyone know what is difference using app.listen(port) and using http to create a server and listen to the port ?

  • @andreasweber952
    @andreasweber952 4 ปีที่แล้ว +1

    I am using the vscode Extension "Rest Client" instead of Postman which is good to share the API Requests which each other working on the same code.

  • @cruzjurado5471
    @cruzjurado5471 6 ปีที่แล้ว +2

    What is that package-lock file when you add express? (min 5:24 aprox)

    • @MrEffg
      @MrEffg 6 ปีที่แล้ว +4

      package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json . It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates. (c) npm documentation

    • @cruzjurado5471
      @cruzjurado5471 6 ปีที่แล้ว

      thanks!

  • @sarimali8853
    @sarimali8853 4 ปีที่แล้ว

    It's working

  • @shwetaverma4770
    @shwetaverma4770 3 ปีที่แล้ว

    Sir I am not able to see part 1 of this API series..can you share the link of part 1

  • @akapoolka8325
    @akapoolka8325 6 ปีที่แล้ว

    Why can we omit file extension at 11:01? We don't use web pack, which as you, Max, have explained in React course on Udemy, handles the file extensions, including .js and .jsx files. Did you I misunderstand you?

    • @20cmusic
      @20cmusic 6 ปีที่แล้ว

      'require' is one of the core functions of node.js. If there is no file extension, require function automatically add '.js' at the end of the parameter.

  • @stanlyqqark5744
    @stanlyqqark5744 6 ปีที่แล้ว +2

    Спасибо за уроки!

  • @sujznamatya596
    @sujznamatya596 5 ปีที่แล้ว

    I tried the same code and the page does not works where as i did
    const server = http.createServer(app);
    but does not works. any suggestion plz

  • @cinquain0
    @cinquain0 5 ปีที่แล้ว

    Fire!

  • @MayOcampo
    @MayOcampo 6 ปีที่แล้ว +12

    I got no response on linux mint... got timeout error... what am i missing here?

    • @gaborballa9614
      @gaborballa9614 4 ปีที่แล้ว

      100% work on linux mint

    • @viniciusvelloso1575
      @viniciusvelloso1575 3 ปีที่แล้ว +3

      In my case, it was a typo ('http.createServer()' instead of 'http.createServer(app)').

    • @shakhawathossainshahin1225
      @shakhawathossainshahin1225 3 ปีที่แล้ว

      @@viniciusvelloso1575 thanks man. saved my day...

    • @mattdaroo2790
      @mattdaroo2790 3 ปีที่แล้ว

      I ended up using server.listen(3300); use app.listen(3300, () => console.log(`Listening on port ${port}...`));
      This will use the express server, not the http server.

    • @mattdaroo2790
      @mattdaroo2790 3 ปีที่แล้ว

      @@viniciusvelloso1575 That's true and it works. I completely missed it in the video when he typed the app as a parameter

  • @lesegoseikali2422
    @lesegoseikali2422 ปีที่แล้ว

    When creating the "app.use" what does the => represent?

  • @yigitruzgaruzun7289
    @yigitruzgaruzun7289 4 ปีที่แล้ว

    You are wonderful. ı speak foreign language than you. but you taught this lesson to me awesome. Thanks

    • @academind
      @academind  4 ปีที่แล้ว

      Happy to read that, thank you for your comment!

    • @yigitruzgaruzun7289
      @yigitruzgaruzun7289 4 ปีที่แล้ว

      @@academind Thanks :)

  • @mdvenkateshnuhk8034
    @mdvenkateshnuhk8034 5 ปีที่แล้ว

    Thanks
    but i am little confused about what will be the 3 rd parameter that browser takes in app.use((req,res,next) [i mean next parameter ]

    • @romainjacquel1698
      @romainjacquel1698 5 ปีที่แล้ว

      next moves to the next operation.
      function Todo () {
      // Your code
      next ()
      }

  • @shwetadubey9238
    @shwetadubey9238 4 ปีที่แล้ว

    TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them..i got the error when run on node js..please help me

  • @nabeeltahir6013
    @nabeeltahir6013 5 ปีที่แล้ว

    Humble request to make tutorial ticket system using Laravel

  • @ivan89pln
    @ivan89pln 4 ปีที่แล้ว

    Hello, nice video but i only dont understand why you start the app using pure nodejs code instead of expressjs ? Is there any reason for that ?

  • @ambientsoda106
    @ambientsoda106 3 ปีที่แล้ว

    but if I host node on a goddady server, in need to use node on my laptop to setup the files then use ftp to put them on the server - you cant work on node js as you are on the say goddady server..

  • @MS-xu1ks
    @MS-xu1ks 4 ปีที่แล้ว

    Can't we use PUT instead of PATCH?

  • @user-zb5jp4ti1d
    @user-zb5jp4ti1d 6 ปีที่แล้ว

    Max... may i ask a quick query abt nomenclature... REST and RESTful... when do we use one or the other

    • @academind
      @academind  6 ปีที่แล้ว

      REST is simply just the shorter form of RESTful :)

    • @user-zb5jp4ti1d
      @user-zb5jp4ti1d 6 ปีที่แล้ว

      Academind got it. Thank you

  • @shreshthsingh7744
    @shreshthsingh7744 3 ปีที่แล้ว

    I hope these APIs could also be used in flutter?

  • @pigpig333666999
    @pigpig333666999 6 ปีที่แล้ว

    太棒了!

  • @daniellaerachannel
    @daniellaerachannel 6 ปีที่แล้ว

    great teacher

    • @academind
      @academind  6 ปีที่แล้ว

      Happy to read that, thank you very much!

  • @wederpacheco1470
    @wederpacheco1470 6 ปีที่แล้ว

    Max, i am still missing a node.js complete udemy course. Can we hope for it any time in a close future? That would be neat! Great video btw!

    • @academind
      @academind  6 ปีที่แล้ว +1

      No concrete plans as of now to be honest but we'll see - Node certainly is an interesting topic. Thank you for your comment Wéder, awesome to read that you like the video!

    • @PavanKumar-vu2mm
      @PavanKumar-vu2mm 6 ปีที่แล้ว

      Yes! We need a course from you on nodejs and mongodb!

  • @88noname88
    @88noname88 4 ปีที่แล้ว

    Do you know why he using http wrapper. We can use express app.listen(PORT) without http library

  • @kalpeshpatil741
    @kalpeshpatil741 3 ปีที่แล้ว

    good information :)

  • @vijaypawar2176
    @vijaypawar2176 5 ปีที่แล้ว

    Awesome

  • @UsamaShafqatKhan
    @UsamaShafqatKhan 5 ปีที่แล้ว

    I’m using the vs code and I’ve installed the recommended extensions for work with node js but i don’t get the intellisense like yours.

    • @ss2851
      @ss2851 4 ปีที่แล้ว

      Install required package from within VS Code

  • @dijitaldurum7160
    @dijitaldurum7160 5 ปีที่แล้ว

    who faces with the =>(unexpected token) problem ?

  • @nicklowe_
    @nicklowe_ 4 ปีที่แล้ว

    This is a great serious

  • @saisreenivas1003
    @saisreenivas1003 6 ปีที่แล้ว +1

    max can you explain callback hell in nodejs and how to avoid it

    • @academind
      @academind  6 ปีที่แล้ว +1

      Hi, check this video - it should explain everything you need (it applies for Node.js, too): th-cam.com/video/jgWnccjXR4I/w-d-xo.html

  • @brotherx6205
    @brotherx6205 4 ปีที่แล้ว +4

    could this work with a react js application?

    • @El_ii
      @El_ii 4 ปีที่แล้ว

      Yes

  • @shivamkakkar27
    @shivamkakkar27 4 ปีที่แล้ว

    Welcome back to this serious

  • @antonioguiotto529
    @antonioguiotto529 5 ปีที่แล้ว

    bro u damn good at what u do

    • @academind
      @academind  5 ปีที่แล้ว

      Thanks so much Antonio, this really means a lot to me!

    • @antonioguiotto529
      @antonioguiotto529 5 ปีที่แล้ว

      @@academind by the way your current logo rock balls

  • @yakut54
    @yakut54 3 ปีที่แล้ว

    Спасибо за науку! Разговорный английский плохо понимаю, но тут всё интуитивно понятно )

  • @MrPhiineasKK
    @MrPhiineasKK 6 ปีที่แล้ว +1

    Is it bad practice to start the server like this?
    app.listen(port, ()=>{
    console.log('Server started on port '+port);
    });

    • @bottletyre
      @bottletyre 6 ปีที่แล้ว

      Please post what is the best way ?

    • @MrPhiineasKK
      @MrPhiineasKK 6 ปีที่แล้ว

      Srry, i forgot the '?'
      That was a question if the code above was bad practice, because he did it in a different way!!

    • @mq101t
      @mq101t 6 ปีที่แล้ว

      ??this reply for my question

    • @MrPhiineasKK
      @MrPhiineasKK 6 ปีที่แล้ว +1

      No, just another question that happened to be the same :)

  • @kuttikrishnankodoth1463
    @kuttikrishnankodoth1463 5 ปีที่แล้ว

    Hi ,first of all thank you for the wonderful tutorial.
    I have a small doubt , about folder structuring.
    Instead of creating the app.js and server.js inside the root folder, i created in .git--> root-->src-->api-->my-node-api-->{server.js,app.js}
    and I am trying to start the server from root and, it wasn't working .I had to go to my-node-api folder to run the "node server " command to make this work.
    Is there any way to configure, such that I can run "node server " from the .git--> root.

  • @rahulshukla9005
    @rahulshukla9005 5 ปีที่แล้ว

    how to use single node js api for mobile app(android/ios) and web(template engine) both?

    • @redtech9204
      @redtech9204 5 ปีที่แล้ว

      RESTful api is what is used for both as it recieves and sends data only. It doesn't care about the clients or what the client see's such as html styled with css, or the document object model. It only cares about the data that's sent and recieved.

    • @redtech9204
      @redtech9204 5 ปีที่แล้ว

      It's not necessarily node.js but the api you create if that makes sense.