|
|
@@ -22,16 +22,16 @@ var opts = {
|
|
|
//Creates webcam instance
|
|
|
var Webcam = NodeWebcam.create(opts);
|
|
|
|
|
|
-Webcam.list(function (list) {
|
|
|
- console.log(list)
|
|
|
-});
|
|
|
-
|
|
|
const app = express();
|
|
|
const port = 3000;
|
|
|
const picturePath = path.resolve('public/pictures');
|
|
|
|
|
|
console.log('Using picture path at:', picturePath);
|
|
|
-fs.mkdirSync(picturePath);
|
|
|
+try {
|
|
|
+ fs.mkdirSync(picturePath);
|
|
|
+} catch (e) {
|
|
|
+ if (e.code !== 'EEXIST') console.log(e);
|
|
|
+}
|
|
|
|
|
|
app.get('/pictures', function (req, res, next) {
|
|
|
var entries = fs.readdirSync(picturePath);
|