-function removePods (req: express.Request, res: express.Response, next: express.NextFunction) {
- const host = req.body.signature.host
+async function addPods (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const information = req.body
+
+ const pod = db.Pod.build(information)
+ const podCreated = await pod.save()
+
+ await sendOwnedDataToPod(podCreated.id)
+
+ const cert = await getMyPublicCert()
+ return res.json({ cert, email: CONFIG.ADMIN.EMAIL })
+}
+
+async function remotePodsList (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const pods = await db.Pod.list()
+
+ return res.json(getFormattedObjects<FormattedPod, PodInstance>(pods, pods.length))
+}