You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
488 B
JavaScript

'use strict';
var express = require('express');
var cors = require('cors');
// require and use "multer"...
var app = express();
app.use(cors());
app.use('/public', express.static(process.cwd() + '/public'));
app.get('/', function (req, res) {
res.sendFile(process.cwd() + '/views/index.html');
});
app.get('/hello', function(req, res){
res.json({greetings: "Hello, API"});
});
app.listen(process.env.PORT || 3000, function () {
console.log('Node.js listening ...');
});