2019-02-07 10:11:20 +01:00
|
|
|
import $ from 'cafy';
|
|
|
|
import define from '../../define';
|
|
|
|
import Instance from '../../../../models/instance';
|
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
requireCredential: false,
|
|
|
|
|
|
|
|
params: {
|
|
|
|
host: {
|
|
|
|
validator: $.str
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-22 03:46:58 +01:00
|
|
|
export default define(meta, async (ps, me) => {
|
2019-02-07 10:11:20 +01:00
|
|
|
const instance = await Instance
|
|
|
|
.findOne({ host: ps.host });
|
|
|
|
|
2019-02-22 03:46:58 +01:00
|
|
|
return instance;
|
|
|
|
});
|