Commit 8d35043e authored by Anton's avatar Anton

Initial

parents
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
# Ignore generated files
dist/*
README.md
_book/*
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
es6: true,
node: true,
mocha: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: [
'standard'
],
// required to lint *.vue files
plugins: [
'import'
],
globals: {},
// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 0,
'one-var': 0,
'import/first': 0,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
'no-return-await': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }]
}
}
# Node.js
node_modules
bower_components
*.log
*.db
*.nedb
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
cmake-build-release/
# NAPI
build/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Book build output
_book
# eBook build output
*.epub
*.mobi
*.pdf
# JetBrains
.idea
# nyc coverage
.nyc_output
# Quasar
.quasar
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www
10.16.3
FROM node:10
MAINTAINER Motion Bank
WORKDIR /app
COPY . .
RUN rm -rf node_modules
RUN npm install --production
EXPOSE 3131
ENTRYPOINT ["node", "src"]
The MIT License (MIT)
Copyright © 2018 Mainz University of Applied Sciences (Motion Bank Project)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
[comment]: # (ACHTUNG! This is an autogenerated file and will be automatically overwritten)
[comment]: # (To edit its contents please refer to the project dir '.readme')
# id-mapper
> Provide internal permanent URIs
## License
:copyright: 2019 Mainz University of Applied Sciences (Motion Bank Project) –
Released under the [MIT](https://github.com/motionbank-js/id-mapper/blob/master/LICENSE) license
{
"http": {
"host": "0.0.0.0",
"port": 3131
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "id-mapper",
"version": "1.0.0",
"description": "Provide internal permanent URIs",
"main": "src/index.js",
"scripts": {
"docker-build": "docker build -t motionbank/id-mapper:latest .",
"docker-push": "docker push motionbank/id-mapper:latest",
"docker-release": "npm run docker-build && npm run docker-push",
"lint": "eslint src/. --config .eslintrc.js",
"metapak": "metapak",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Mainz University of Applied Sciences (Motion Bank Project)",
"license": "MIT",
"metapak": {
"configs": [
"readme",
"eslint"
]
},
"devDependencies": {
"metapak": "^1.0.3",
"metapak-motionbank": "^1.16.0"
},
"dependencies": {
"@polka/send-type": "^0.4.0",
"mbjs-generic-api": "1.3.4"
}
}
#!/bin/sh
# Automagically generated by metapak, do not change in place.
# Your changes would be loose on the next npm install run.
npm run lint || exit 0;
npm run metapak -- -s || exit 0
\ No newline at end of file
const
send = require('@polka/send-type'),
GenericAPI = require('mbjs-generic-api')
const setup = async function () {
const api = new GenericAPI()
await api.setup()
api.app.get('/:resource/:uuid', (req, res) => {
const mappings = {
annotations: { host: 'https://api.motionbank.org', path: '/annotations', code: 302 },
maps: { host: 'https://api.motionbank.org', path: '/maps', code: 302 },
cells: { host: 'https://api.motionbank.org', path: '/cells', code: 302 },
documents: { host: 'https://api.motionbank.org', path: '/documents', code: 302 },
persons: { host: 'https://api.motionbank.org', path: '/profiles', code: 302 }
}
const mapped = mappings[req.params.resource]
if (mapped && req.params.uuid) {
send(res, mapped.code, mapped.body, { Location: `${mapped.host}${mapped.path}/${req.params.uuid}` })
}
else {
send(res, 404, 'Not found')
}
})
await api.start()
}
setup().catch(err => {
process.stderr.write(err.message + '\n')
process.stderr.write(err.stack + '\n')
process.exit(err.code)
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment