SMAM (short for Send Me A Mail) is a free (as in freedom) contact form embedding software.

server.js 582B

12345678910111213141516171819202122232425262728
  1. var bodyParser = require('body-parser');
  2. var express = require('express');
  3. var app = express();
  4. // Logging
  5. var printit = require('printit');
  6. var log = printit({
  7. prefix: 'SMAM',
  8. date: true
  9. });
  10. // Serve static (JS + HTML) files
  11. app.use(express.static('front'));
  12. app.use(bodyParser.urlencoded({ extended: true }));
  13. app.use(bodyParser.json());
  14. app.post('/send', function(req, res, next) {
  15. res.header('Access-Control-Allow-Origin', '*');
  16. res.status(200).send();
  17. console.log(req.body);
  18. });
  19. app.listen(1970, function() {
  20. log.info("Server started");
  21. });