Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var app = express();
- var bodyParser = require('body-parser');
- app.use(express.static('public'));
- app.use( bodyParser.json() ); // to support JSON-encoded bodies
- app.use(bodyParser.urlencoded({ // to support URL-encoded bodies
- extended: true
- }));
- app.get('/index.htm', function (req, res) {
- res.sendFile( __dirname + "/" + "index.htm" );
- })
- app.post('/ajaxTarget', function (req, res) {
- console.log(req.body);
- });
- var server = app.listen(8081, function () {
- var host = server.address().address
- var port = server.address().port
- console.log("Example app listening at http://%s:%s", host, port)
- });
Advertisement
Add Comment
Please, Sign In to add comment