Added basic mail functionality and new npm start command in ./
This commit is contained in:
parent
d11238e19e
commit
25a32a234b
1288
package-lock.json
generated
1288
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "concurrently \"ng serve\" \"nodemon ./server/bin/www\"",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
@ -28,10 +28,11 @@
|
|||||||
"@angular/cli": "~8.3.14",
|
"@angular/cli": "~8.3.14",
|
||||||
"@angular/compiler-cli": "~8.2.11",
|
"@angular/compiler-cli": "~8.2.11",
|
||||||
"@angular/language-service": "~8.2.11",
|
"@angular/language-service": "~8.2.11",
|
||||||
"@types/node": "~8.9.4",
|
|
||||||
"@types/jasmine": "~3.3.8",
|
"@types/jasmine": "~3.3.8",
|
||||||
"@types/jasminewd2": "~2.0.3",
|
"@types/jasminewd2": "~2.0.3",
|
||||||
|
"@types/node": "~8.9.4",
|
||||||
"codelyzer": "^5.0.0",
|
"codelyzer": "^5.0.0",
|
||||||
|
"concurrently": "^5.0.0",
|
||||||
"jasmine-core": "~3.4.0",
|
"jasmine-core": "~3.4.0",
|
||||||
"jasmine-spec-reporter": "~4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"karma": "~4.1.0",
|
"karma": "~4.1.0",
|
||||||
@ -39,6 +40,7 @@
|
|||||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||||
"karma-jasmine": "~2.0.1",
|
"karma-jasmine": "~2.0.1",
|
||||||
"karma-jasmine-html-reporter": "^1.4.0",
|
"karma-jasmine-html-reporter": "^1.4.0",
|
||||||
|
"nodemon": "^1.19.4",
|
||||||
"protractor": "~5.4.0",
|
"protractor": "~5.4.0",
|
||||||
"ts-node": "~7.0.0",
|
"ts-node": "~7.0.0",
|
||||||
"tslint": "~5.15.0",
|
"tslint": "~5.15.0",
|
||||||
|
@ -6,6 +6,7 @@ var logger = require('morgan');
|
|||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
|
|
||||||
var indexRouter = require('./routes/index');
|
var indexRouter = require('./routes/index');
|
||||||
|
var mailRouter = require('./routes/mail');
|
||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ app.use(cors())
|
|||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
|
app.use('/mail', mailRouter);
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
|
0
server/database/confirmations.json
Normal file
0
server/database/confirmations.json
Normal file
@ -1 +1 @@
|
|||||||
{"data":[false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false]}
|
{"data":[false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,true,false,false,false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false]}
|
2553
server/package-lock.json
generated
2553
server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,9 +11,11 @@
|
|||||||
"express": "~4.16.1",
|
"express": "~4.16.1",
|
||||||
"http-errors": "~1.6.3",
|
"http-errors": "~1.6.3",
|
||||||
"morgan": "~1.9.1",
|
"morgan": "~1.9.1",
|
||||||
"pug": "^2.0.4"
|
"pug": "^2.0.4",
|
||||||
|
"sendmail": "^1.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cors": "^2.8.5"
|
"cors": "^2.8.5",
|
||||||
|
"nodemon": "^1.19.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
server/routes/mail.js
Normal file
18
server/routes/mail.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const sendmail = require('sendmail')({silent: true});
|
||||||
|
|
||||||
|
var router = express.Router();
|
||||||
|
|
||||||
|
router.post('/', (req, res, _next) => {
|
||||||
|
sendmail({
|
||||||
|
from: 'surpise-box@jobbel.nl',
|
||||||
|
to: req.body.email,
|
||||||
|
subject: 'test sendmail',
|
||||||
|
html: 'Mail of test sendmail',
|
||||||
|
}, function(err, reply) {
|
||||||
|
if (err) res.json({result: err});
|
||||||
|
else res.json({result: reply});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
Loading…
Reference in New Issue
Block a user