mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
wip links
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { api, APIError } from "encore.dev/api"
|
import { api } from "encore.dev/api"
|
||||||
// import { startWorker } from "jazz-nodejs"
|
// import { startWorker } from "jazz-nodejs"
|
||||||
// import { ID } from "jazz-tools"
|
// import { ID } from "jazz-tools"
|
||||||
import { secret } from "encore.dev/config"
|
import { secret } from "encore.dev/config"
|
||||||
@@ -10,9 +10,9 @@ const jazzPublicGlobalGroup = secret("jazzPublicGlobalGroup")
|
|||||||
|
|
||||||
export const testRoute = api(
|
export const testRoute = api(
|
||||||
{ expose: true, method: "GET", path: "/test" },
|
{ expose: true, method: "GET", path: "/test" },
|
||||||
async ({}: {}): Promise<void> => {
|
async ({}: {}): Promise<{ message: string }> => {
|
||||||
console.log(jazzPublicGlobalGroup(), "group")
|
|
||||||
log.info("better logs from encore")
|
log.info("better logs from encore")
|
||||||
|
return { message: `Hello from encore` }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,27 @@
|
|||||||
// it is responsible for adding and getting links into LA from API
|
// it is responsible for adding and getting links into LA from API
|
||||||
|
|
||||||
import { api, APIError } from "encore.dev/api"
|
import { api, APIError } from "encore.dev/api"
|
||||||
// import { startWorker } from "jazz-nodejs"
|
import { startWorker } from "jazz-nodejs"
|
||||||
import { secret } from "encore.dev/config"
|
import { secret } from "encore.dev/config"
|
||||||
|
import log from "encore.dev/log"
|
||||||
|
|
||||||
const jazzWorkerSecret = secret("jazzWorkerSecret")
|
const jazzWorkerSecret = secret("jazzWorkerSecret")
|
||||||
|
|
||||||
export const addPersonalLink = api(
|
export const saveLink = api(
|
||||||
{ expose: true, method: "POST", path: "/save-link" },
|
{ expose: true, method: "POST", path: "/save-link" },
|
||||||
async ({ url }: { url: string }): Promise<void> => {
|
// TODO: perhaps apiKey only is enough?
|
||||||
|
async ({ url, email, apiKey }: { url: string; email: string; apiKey: string }): Promise<void> => {
|
||||||
// const { worker } = await startWorker({
|
// const { worker } = await startWorker({
|
||||||
// accountID: "co_zhvp7ryXJzDvQagX61F6RCZFJB9",
|
// accountID: "co_zhvp7ryXJzDvQagX61F6RCZFJB9",
|
||||||
// accountSecret: JAZZ_WORKER_SECRET
|
// accountSecret: JAZZ_WORKER_SECRET
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
// log.info(jazzWorkerSecret)
|
||||||
|
|
||||||
|
if (!url.includes("http")) {
|
||||||
|
throw APIError.invalidArgument("url must include http")
|
||||||
|
}
|
||||||
|
log.info("addPersonalLink", { url })
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
BIN
api/bun.lockb
BIN
api/bun.lockb
Binary file not shown.
@@ -1 +1,7 @@
|
|||||||
Using [Encore](https://encore.dev).
|
Using [Encore](https://encore.dev).
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```
|
||||||
|
encore run
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user