filemetadata/server.js

24 lines
488 B
JavaScript
Raw Normal View History

2017-02-18 20:02:08 +01:00
'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 ...');
});