comparison api/server/ui/absolute-path.js @ 169:9fcfccb18b16

feat: Added draft version of API specification for server Open API specification available under /api/server UI version served with yarn swagger from client folder - port 5000
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 10 Jul 2018 10:36:50 +0200
parents
children
comparison
equal deleted inserted replaced
168:e4e4a0e6338e 169:9fcfccb18b16
1 /*
2 * getAbsoluteFSPath
3 * @return {string} When run in NodeJS env, returns the absolute path to the current directory
4 * When run outside of NodeJS, will return an error message
5 */
6 const getAbsoluteFSPath = function () {
7 // detect whether we are running in a browser or nodejs
8 if (typeof module !== "undefined" && module.exports) {
9 return require("path").resolve(__dirname)
10 }
11 throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
12 }
13
14 module.exports = getAbsoluteFSPath