]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Adding missing bin in tileserver-mapnik 01/401/1
authorjsimomaa <jani.simomaa@gmail.com>
Tue, 4 Apr 2017 06:58:56 +0000 (09:58 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Tue, 4 Apr 2017 06:58:56 +0000 (09:58 +0300)
refs #6958

Change-Id: I711cfa80c3102bb6cb52a3c5b82706fd79016b9c

org.simantics.maps.server/server/tileserver-mapnik/.gitignore
org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js [new file with mode: 0644]

index 68b9e27759d7ca5877d5a46b29f674ec48e3c62c..b740c70db93a09641d1bc782ca600522d9709eb4 100644 (file)
@@ -1,2 +1,5 @@
 node_modules/
 bower_components/
+
+# allow bin 
+!bin/
\ No newline at end of file
diff --git a/org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js b/org.simantics.maps.server/server/tileserver-mapnik/bin/tessera.js
new file mode 100644 (file)
index 0000000..34f5d3d
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env node
+
+"use strict";
+
+var nomnom = require("nomnom")
+  .options({
+    uri: {
+      position: 0,
+      help: "tilelive URI to serve"
+    },
+    cacheSize: {
+      full: "cache-size",
+      abbr: "C",
+      metavar: "SIZE",
+      help: "Set the cache size (in MB)",
+      default: 10
+    },
+    config: {
+      abbr: "c",
+      metavar: "CONFIG",
+      help: "Provide a configuration file or directory"
+    },
+    port: {
+      abbr: "p",
+      metavar: "PORT",
+      help: "Set the HTTP Port",
+      default: 8080
+    },
+    require: {
+      abbr: "r",
+      metavar: "MODULE",
+      help: "Require a specific tilelive module",
+      list: true
+    },
+    sourceCacheSize: {
+      full: "source-cache-size",
+      abbr: "S",
+      metavar: "SIZE",
+      help: "Set the source cache size (in # of sources)",
+      default: 10
+    },
+    version: {
+      abbr: "v",
+      flag: true,
+      help: "Show version info",
+      callback: function() {
+        return "tessera v" + require("../package.json").version;
+      }
+    }
+  })
+  .help("A tilelive URI or configuration file is required.");
+
+var argv = (process.env.TESSERA_OPTS || "")
+  .split(" ")
+  .concat(process.argv.slice(2))
+  .filter(function(x) {
+    return !!x;
+  });
+
+var opts = nomnom.parse(argv);
+
+switch (true) {
+case opts.version:
+  return process.exit();
+
+case !opts.uri && !opts.config:
+  return nomnom.print(nomnom.getUsage());
+
+default:
+  return require("../server")(opts);
+}