![]() ![]() That will allow us to use ES6 features of JavaScript that we have access to when developing React Native apps. ![]() Install Dependenciesįirst, install dev dependencies that we’ll going to need during development and to run the app locally: npm install -save-dev babel babel-cli babel-preset-es2015 babel-preset-stage-0 nodemonĪnd next, install all of the rest: npm install -save body-parser express moment mongoose morgan That will create package.json file that is used to store your app’s info, scripts, and dependencies. It’s safe to give default answers to all questions. Next, initialize new Node.js project by executing: npm initĪnd answering a few questions asked in the terminal. Now, let’s create a folder that MongoDB will use to store our database data: sudo mkdir -p /data/dbĪnd set the correct permissions: sudo chmod 777 /data/dbįirst, create a new folder: mkdir MovieTicketsBackend To install MongoDB open Terminal App and execute: brew install mongodb So, this time we’re going to build an API backend for our movie tickets booking app that will store movie data in a MongoDB database and will return it to the app as JSON data.įor your reference, the final code for the app we’re building can be found in this GitHub repo. That is obviously not what you want to do for a real world app. In the previous tutorial, we built movie tickets booking app that stored all movie data in javascript files.
0 Comments
Leave a Reply. |