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 multer = require('multer') | |
const app = express() | |
const upload = multer() | |
app.post('/api/parse', upload.any(), async (req, res) => { | |
const body = req.body |
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 [project_name] | |
cd [project_name] | |
npm init -y | |
touch index.js | |
npm i express multer | |
npm i nodemon --save-dev | |
code . |
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 [project_name] | |
cd [project_name] | |
npm init -y | |
touch index.js | |
npm i express @sendgrid/mail | |
npm i nodemon –save-dev | |
code . |
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 mail = require("@sendgrid/mail"); | |
const app = express(); | |
// It is highly recommended to store the API Keys in a seperate file and DO NOT check it in Git | |
mail.setApiKey("__sendgrid_api_key__"); | |
app.post('/email/send', (req, res) => { | |
// Any 1 of to, cc or bcc are required to successfully send an email. |
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 mail = require("@sendgrid/mail"); | |
const app = express(); | |
// It is highly recommended to store the API Keys in a seperate file and DO NOT check it in Git | |
mail.setApiKey("__sendgrid_api_key__"); | |
app.post('/email/send', (req, res) => { | |
// Any 1 of to, cc or bcc are required to successfully send an email. |
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
{ | |
"from": { | |
"name": "Rishav", | |
"email": "[email protected]" | |
}, | |
"to": [ | |
"[email protected]", | |
"[email protected]" | |
], | |
"cc": [ |
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 mail = require("@sendgrid/mail"); | |
const app = express(); | |
// It is highly recommended to store the API Keys in a seperate file and DO NOT check it in Git | |
mail.setApiKey("__sendgrid_api_key__"); | |
app.post('/email/send', (req, res) => { | |
let { |
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(); | |
let port = process.env.PORT || 3000; | |
app.route('/') | |
.get((req, res) => { | |
console.log(req.body); | |
res.sendStatus(200); |