ebac854da8
* The MongoDB/Mongoose data storage is removed in favor of Sequelize. This abstracts over SQLite or RDBMs like PostgreSQL and MSSQL. The default is SQLite, which significantly simplifies deployments in end-user environments. * As Spacedeck now has no more mandatory server dependencies, we can wrap it in Electron and ship it as a desktop application. * Removes docker-compose.yml * First version of import UI
21 lines
433 B
JavaScript
21 lines
433 B
JavaScript
'use strict';
|
|
const db = require('../models/db');
|
|
const Sequelize = require('sequelize');
|
|
const Op = Sequelize.Op;
|
|
|
|
var config = require('config');
|
|
|
|
module.exports = (req, res, next) => {
|
|
var artifactId = req.params.artifact_id;
|
|
db.Artifact.findOne({where: {
|
|
"_id": artifactId
|
|
}}).then(artifact => {
|
|
if (artifact) {
|
|
req['artifact'] = artifact;
|
|
next();
|
|
} else {
|
|
res.sendStatus(404);
|
|
}
|
|
});
|
|
};
|