detect whether local or in server