mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-13 20:00:05 +01:00
update
This commit is contained in:
31
node_modules/bootstrap-colorpicker/serve.js
generated
vendored
Normal file
31
node_modules/bootstrap-colorpicker/serve.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Script for serving index.html and other static content with Node.
|
||||
Run it using `node serve` from your terminal and navigate to http://localhost:5000
|
||||
in order to test your changes in the browser.
|
||||
*/
|
||||
|
||||
var http = require('http'), fs = require('fs'), mimeTypes = {
|
||||
'html': 'text/html',
|
||||
'css': 'text/css',
|
||||
'js': 'text/javascript',
|
||||
'json': 'application/json',
|
||||
'png': 'image/png',
|
||||
'jpg': 'image/jpg'
|
||||
};
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
var file = (req.url === '/') ? 'index.html' : "." + req.url;
|
||||
var ext = require('path').extname(file),
|
||||
type = (mimeTypes[ext] ? mimeTypes[ext] : '');
|
||||
|
||||
fs.exists(file, function (exists) {
|
||||
if (exists) {
|
||||
res.writeHead(200, {'Content-Type': type});
|
||||
fs.createReadStream(file).pipe(res);
|
||||
} else {
|
||||
console.warn(file, ' does not exit');
|
||||
}
|
||||
});
|
||||
}).listen(5000);
|
||||
|
||||
console.log("Your bootstrap-colorpicker development URL is http://localhost:5000");
|
||||
Reference in New Issue
Block a user