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 router = express.Router(); | |
// Controller Import | |
const checkController = require("../controllers/check.controller"); | |
// Route Declaration | |
router.route("/") | |
.get(checkController.createCheck) | |
.post(checkController.createCheckPost); |
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 mongoose = require("mongoose"); | |
const Schema = mongoose.Schema; | |
// Check schema definition | |
const CheckSchema = new Schema( | |
{ | |
checkId: { type: String, required: true }, | |
description: { type: String, default: null }, | |
to: { type: Schema.Types.Mixed, default: null }, | |
from: { type: Schema.Types.Mixed, default: null }, |
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
import express from "express"; | |
import mongoose from "mongoose"; | |
import cors from "cors"; | |
import path from "path"; | |
const app = express(); | |
const PORT = 5000; | |
const dbConnectionString = "mongodb://localhost:27017/lobchecks" | |
app.use(express.urlencoded({ extended: true })); | |
app.use(express.text()); |
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" | |
] | |
} |
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
{ | |
"name": "lobchecks", | |
"version": "1.0.0", | |
"description": "A sample node project, demonstrating the use of Lob checks.", | |
"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
"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" |
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
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 init |