filemetadata/server.js
2017-02-18 19:02:08 +00:00

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 ...');
});