2019-02-07 18:11:20 +09: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 11:46:58 +09:00
|
|
|
export default define(meta, async (ps, me) => {
|
2019-02-07 18:11:20 +09:00
|
|
|
const instance = await Instance
|
|
|
|
.findOne({ host: ps.host });
|
|
|
|
|
2019-02-22 11:46:58 +09:00
|
|
|
return instance;
|
|
|
|
});
|