Download pool/shard011/JavaScript/0068989_ApiConfig.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 909 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard011/JavaScript/0068989_ApiConfig.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard011/JavaScript/0068989_ApiConfig.js
-
curl -L -o 0068989_ApiConfig.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard011/JavaScript/0068989_ApiConfig.js
909 Bytes
| /** | |
| Config API routing, URL etc... | |
| */ | |
| ; | |
| var config = function config(app, version) { | |
| console.log("config! " + version); | |
| var bodyParser = require('body-parser'); | |
| // configure app to use bodyParser() | |
| // this will let us get the data from a POST | |
| app.use(bodyParser.urlencoded({ | |
| extended: true | |
| })); | |
| app.use(bodyParser.json()); | |
| }; | |
| /** | |
| * Set web routing to use | |
| * */ | |
| var addRoutes = function addRoutes(app, version) { | |
| var router = require('../routing/routing-' + version); | |
| app.use('/api/v' + version, router); | |
| }; | |
| /** | |
| Return web server port | |
| */ | |
| var port = function port() { | |
| var portGlobal = process.env.PORT; | |
| console.log("portGlobal = " + portGlobal); | |
| var port = portGlobal /*|| portParameter*/ || '9090'; | |
| console.log("port = " + port); | |
| return port; | |
| }; | |
| module.exports = { | |
| config: config, port: port, addRoutes: addRoutes | |
| }; |