21 lines
472 B
JavaScript
21 lines
472 B
JavaScript
|
// Main File, configure and start the Server
|
||
|
|
||
|
// Load the modules
|
||
|
var express = require("express");
|
||
|
var tempdb = require("./routes/tempdb.js");
|
||
|
|
||
|
var srv = express();
|
||
|
|
||
|
srv.configure(function() {
|
||
|
srv.use(express.logger('dev'));
|
||
|
srv.use(express.bodyParser());
|
||
|
});
|
||
|
|
||
|
srv.get("/temp", tempdb.getAll);
|
||
|
srv.get("/temp/:id", tempdb.getTemp);
|
||
|
srv.post("/temp", tempdb.addTemp);
|
||
|
srv.put("/temp/:id", tempdb.updTemp);
|
||
|
|
||
|
srv.listen(3000);
|
||
|
console.log("Server started on port 3000.");
|