diff options
Diffstat (limited to 'src/server/Utils.hx')
| -rw-r--r-- | src/server/Utils.hx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/Utils.hx b/src/server/Utils.hx index abce1c0..40fa282 100644 --- a/src/server/Utils.hx +++ b/src/server/Utils.hx @@ -1,10 +1,15 @@ package server; +import sys.FileSystem; import js.node.Https; import js.node.Os; class Utils { + public static function ensureDir(path:String):Void { + if (!FileSystem.exists(path)) FileSystem.createDirectory(path); + } + public static function getGlobalIp(callback:(ip:String)->Void):Void { // untyped to skip second null argument for node < v10 Https.get(untyped "https://myexternalip.com/raw", r -> { |
