Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Latest commit

 

History

History
History
28 lines (22 loc) · 869 Bytes

File metadata and controls

28 lines (22 loc) · 869 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const express = require('express');
const bodyParser = require("body-parser");
const path = require('path');
var customers = require('./routes/customers');
var routes = require('./routes');
var app = express();
app.set('port', process.env.PORT || 4000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'public')));
app.get('/', routes.index);
app.get('/customers', customers.list);
app.get('/customers/add', customers.add);
app.post('/customers/add', customers.save);
app.get('/customers/delete/:id', customers.delete);
app.get('/customers/edit/:id', customers.edit);
app.post('/customers/edit/:id', customers.update);
app.listen(4000, function () {
console.log('Server is running.. on Port 4000');
});
Morty Proxy This is a proxified and sanitized view of the page, visit original site.