You probably were referred here from the linkhere extension README. If not, check that out first to understand what this is about.
There's a few optional environment variables:
PORT: the HTTP port to bind to (default: 3000)DATA_DIR: the directory to store the database and screenshots (should be an absolute path, default: ./data)DISABLE_CHROMIUM_SANDBOX: if set to true, runs Chromium without sandboxing (not recommended, default: false)Note: I strongly recommend using a reverse proxy with HTTPS.
A minimal example:
docker run -v "$(pwd)/linkhere":/data -p 3000:3000 codetheweb/linkhere
This will expose the API on port 3000 and create a folder called linkhere in your current directory that stores the database & screenshots.
Or, for Docker Compose:
version: '3.4'
services:
linkhere:
image: codetheweb/linkhere
restart: always
volumes:
- ./linkhere:/data
ports:
- 3000:3000
git clone https://github.com/link-here/backend.git.yarn install.yarn run build.yarn run start.On the first run, an authentication token will be generated and logged to the console. Copy and paste it into the token field when setting up the extension.
(Currently) all API requests require an authentication token to be included in the headers: Authentication: Bearer ${token}.
All responses take the form of {success: boolean, result: any, error: string | null}.
This package exports types, you can import them with import {APIResult, Link, ...} from '@linkhere/backend'.
/api/v1/linksGET
Query parameters:
limit: number of links to return, default: 10skip: number of links to skip when querying, default: 0hidden: whether or not to return links marked as hidden, default: falseReturns: {links: Link[], hasMore: boolean}.
POST
Body parameter: {urls: string[]}.
Returns: {links: Link[]}.
Note: may return before screenshots have been captured.
PUT
Path parameters:
/:id: id of link to updateBody parameter: Link.
Returns: Link.
/api/v1/screenshotsGET
Path parameters:
/:id: id of linkReturns: Return.DownloadBinaryData.
Content type
Image
Digest
Size
219.9 MB
Last updated
almost 6 years ago
docker pull codetheweb/linkhere