exam/server.js

25 lines
581 B
JavaScript
Raw Normal View History

2017-05-19 14:53:27 +03:00
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
app.use(express.static('./'));
2017-06-07 14:55:51 +03:00
app.get('/api/cart', getCart);
app.post('/api/cart/order', handleOrder);
2017-05-19 14:53:27 +03:00
app.listen(3000, () => console.log('running at: http://localhost:3000'));
2017-06-07 14:55:51 +03:00
function getCart(req, resp) {
resp.set('Content-Type', 'application/json');
resp.end("");
}
function handleOrder(req, resp) {
resp.set('Content-Type', 'application/json');
var order = req.body;
console.log(order);
resp.end("");
2017-05-19 14:53:27 +03:00
}