-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed resource reporting moved package.json under /api
- Loading branch information
Showing
12 changed files
with
559 additions
and
382 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:16 | ||
|
||
MAINTAINER Soichi Hayashi <hayashis@iu.edu> | ||
|
||
WORKDIR /app | ||
|
||
COPY controllers . | ||
COPY resource_test.sh . | ||
COPY *.js ./ | ||
|
||
COPY package.json . | ||
COPY package-lock.json . | ||
|
||
RUN npm install --production | ||
CMD [ "node", "server.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker build -t brainlife/amaretti-api:1.0 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
const express = require('express'); | ||
const router = express.Router(); | ||
const async = require('async'); | ||
const mongoose = require('mongoose'); | ||
const path = require('path'); | ||
const mime = require('mime'); | ||
const multer = require('multer'); | ||
const fs = require('fs'); | ||
|
||
const config = require('../../config'); | ||
const db = require('../models'); | ||
const events = require('../events'); | ||
const common = require('../common'); | ||
|
||
/** | ||
* @apiGroup Taskevent | ||
* @api {get} /taskevent/:taskid | ||
Query Task events | ||
* @apiDescription Returns all task status update events for a given task id | ||
* | ||
* @apiHeader {String} authorization A valid JWT token "Bearer: xxxxx" | ||
* | ||
* @apiSuccess {Object} List of taskevents | ||
*/ | ||
router.get('/:taskId', common.jwt(), function(req, res, next) { | ||
let find = {task_id: req.params.taskId}; | ||
|
||
//access control | ||
if(!req.user.scopes.amaretti || !~req.user.scopes.amaretti.indexOf("admin")) { | ||
find['$or'] = [ | ||
{user_id: req.user.sub}, | ||
{_group_id: {$in: req.user.gids||[]}}, | ||
]; | ||
} | ||
|
||
//if(req.query.select) console.log("select:"+req.query.select); | ||
db.Taskevent.find(find) | ||
.lean() | ||
.sort('date') | ||
.exec(function(err, taskevents) { | ||
if(err) return next(err); | ||
res.json({taskevents}); | ||
}); | ||
}); | ||
|
||
module.exports = router; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.