├── .babelrc ├── .gitignore ├── README.md ├── bin ├── dev └── production ├── package.json └── server └── index.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | .env 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reddit Api Clone - (Part 1) 2 | 3 | This repo is for a series called 'Build a Reddit API Clone' You can follow this YouTube series at [Build a Reddit API Clone - Part 1](https://youtu.be/L5Nle1VXYnw). 4 | 5 | ## Prerequisites 6 | 7 | 1. Basic understanding of how Node.js, Express.js, and MongoDB. 8 | * If you don't feel comfortable with with your skills with either Node.js / Express.js / MongoDB or just want a refresher there are some awesome tutorials to get you up and running that are linked below. 9 | * What is Node.js Exactly? by LearnCode.academy 10 | * Node.js Tutorial for absolute beginners by Traversy Media 11 | * Express Tutorial by Derek Banas 12 | * ExpressJS Crash Course by Traversy Media 13 | * MongoDB Tutorial by Derek Banas 14 | * NodeJS MongoDB Tutorial by Derek Banas 15 | 16 | 2. A running instance of MongoDB 17 | * Install MongoDB Community Edition on OS X 18 | * Install MongoDB Community Edition on Windows 19 | * You also have the option of creating a sandbox MongoDB instance on mLab or another MongoDB hosting service and connecting to that. 20 | * mLab 21 | * Connecting to mLab DB instance 22 | 23 | 3. Download Postman to test and work with our API - Postman Download 24 | 25 | 4. Clone this repo, run ```npm install```, open repo in your text editor of choice, and run ```npm start``` now we're ready to go! 26 | 27 | Bonus: Look over the Mongoose documentation. 28 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | require('dotenv/config') 3 | require('./../server/index') 4 | -------------------------------------------------------------------------------- /bin/production: -------------------------------------------------------------------------------- 1 | require('./../dist/index') 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "babel-nodejs-setup", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon bin/dev", 9 | "clean": "rm -rf dist", 10 | "build": "npm run clean && mkdir dist && babel server -s -d dist", 11 | "production": "npm run build && nodemon bin/production" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/DmsChrisPena/babel-nodejs-setup.git" 16 | }, 17 | "author": "", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/DmsChrisPena/babel-nodejs-setup/issues" 21 | }, 22 | "homepage": "https://github.com/DmsChrisPena/babel-nodejs-setup#readme", 23 | "devDependencies": { 24 | "babel-cli": "^6.22.2", 25 | "babel-preset-es2015": "^6.22.0", 26 | "babel-preset-stage-2": "^6.22.0", 27 | "babel-register": "^6.22.0", 28 | "dotenv": "^4.0.0", 29 | "nodemon": "^1.11.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | console.log('index.js'); 2 | --------------------------------------------------------------------------------