知乎专栏 |
改变java.io.tmpdir的默认值
@GetMapping("/host") public ResponseEntity<String> host() { try { InetAddress addr = InetAddress.getLocalHost(); String hostAddress = addr.getHostAddress().toString(); String hostName = addr.getHostName().toString(); String tmp = String.format("%s: %s", hostAddress, hostName); return ResponseEntity.ok(tmp); } catch (Exception e) { return ResponseEntity.ok(e.toString()); } }