Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define a parameter depending on the hostname

I my Gruntfile.js I need to do something like this (pseudocode):

if (hostname == 'host1') : port=9000
else                     : port=9001

How can I get hostname? (this would be the host where I am running grunt)

like image 311
blueFast Avatar asked Feb 16 '23 20:02

blueFast


1 Answers

var hostname = require("os").hostname();
like image 169
Esailija Avatar answered Feb 19 '23 11:02

Esailija