Download pool/shard006/JavaScript/0037613_server.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037613_server.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard006/JavaScript/0037613_server.js
-
curl -L -o 0037613_server.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037613_server.js
1.28 kB
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express'); | |
| var stylus = require('stylus'); | |
| // Auto-compile sass to css with "compiler" | |
| // and then serve with connect's staticProvider | |
| var app = express.createServer(); | |
| // add the stylus middleware, which re-compiles when | |
| // a stylesheet has changed, compiling FROM src, | |
| // TO dest. dest is optional, defaulting to src | |
| app.use(stylus.middleware({ | |
| src: __dirname + '/views' | |
| , dest: __dirname + '/public' | |
| , compile: compile | |
| })); | |
| // Path to our public directory | |
| var pub = __dirname + '/public'; | |
| // Optional since express defaults to CWD/views | |
| app.set('views', __dirname + '/views'); | |
| app.use(app.router); | |
| app.use(express.static(pub)); | |
| app.use(express.errorHandler({ dump: true, stack: true })); | |
| function compile(str, path, fn) { | |
| stylus(str) | |
| .set('filename', path) | |
| .set('compress', true) | |
| .render(fn); | |
| }; | |
| // Set our default template engine to "jade" | |
| // which prevents the need for extensions | |
| // (although you can still mix and match) | |
| app.set('view engine', 'jade'); | |
| var imageElements = require('./imageElements.js'); | |
| var set1 = imageElements.set1(); | |
| app.get('/', function(req, res){ | |
| res.render('rotator', {elements: set1}); | |
| }); | |
| app.listen(3000); | |
| console.log('Express app started on port 3000'); | |