npm init, express hello world, docker file

pull/1/head
Piero Toffanin 2016-07-04 15:59:07 -05:00
rodzic d2b46a8f00
commit 9aa34619ff
6 zmienionych plików z 56 dodań i 0 usunięć

11
Dockerfile 100644
Wyświetl plik

@ -0,0 +1,11 @@
FROM opendronemap:latest
MAINTAINER Piero Toffanin
RUN apt-get update
RUN apt-get install -y nodejs
RUN mkdir /var/www
WORKDIR "/var/www"
RUN git clone https://github.com/pierotofy/node-OpenDroneMap
RUN npm install
CMD ["/usr/bin/nodejs", "/var/www/index.js"]

2
boot.js 100644
Wyświetl plik

@ -0,0 +1,2 @@
"use strict";

Wyświetl plik

@ -0,0 +1,3 @@
var odm = require("../index");
odm.hello();

12
index.js 100644
Wyświetl plik

@ -0,0 +1,12 @@
"use strict";
let express = require('express');
let app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
});

25
package.json 100644
Wyświetl plik

@ -0,0 +1,25 @@
{
"name": "node-opendronemap",
"version": "0.1.0",
"description": "Node.js API to access OpenDroneMap",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pierotofy/node-OpenDroneMap.git"
},
"keywords": [
"opendronemap"
],
"author": "Piero Toffanin",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/pierotofy/node-OpenDroneMap/issues"
},
"homepage": "https://github.com/pierotofy/node-OpenDroneMap#readme",
"dependencies": {
"express": "^4.14.0"
}
}

3
server.js 100644
Wyświetl plik

@ -0,0 +1,3 @@
exports.hello = () => {
console.log("Hi");
}