This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
address = { | |
name: 'John Doe', | |
address_line1: '101 Green St.', | |
address_line2: 'Ste 500', | |
address_city: 'San Francisco', | |
address_state: 'CA', | |
address_zip: 94107, | |
address_country: 'US' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
app.use((req, res, next) => { | |
next(); | |
}); | |
app.use('/', (req, res, next) => { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir src | |
$ cd src | |
$ mkdir controllers models routes views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install express mongoose cors hbs path lob dotenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install @babel/cli @babel/core @babel/node @babel/preset-env --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"start-dev": "babel-node ./src/index.js", | |
"dev": "nodemon --exec npm run start-dev", | |
"start": "npm run build && node ./build/index.js", | |
"build": "npm run clean && npm run build-babel", | |
"clean": "npx rimraf /F /Q build", | |
"build-babel": "babel src --out-dir build --source-maps inline --copy-files", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "webhook-basics", | |
"version": "1.0.0", | |
"description": "A sample node project, demonstrating the use of Lob Webhooks for emailing and marketing.", | |
"main": "./src/index.js", | |
"scripts": { | |
"start-dev": "babel-node ./src/index.js", | |
"dev": "nodemon --exec npm run start-dev", | |
"start": "npm run build && node ./build/index.js", | |
"build": "npm run clean && npm run build-babel", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch .babelrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": [ | |
"@babel/preset-env" | |
] | |
} |
OlderNewer