Skip to content

Commit

Permalink
Merge dev to stable (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
inetol committed Apr 28, 2024
2 parents 029f3b9 + fd934d3 commit f265e6b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3

- name: "Setup QEMU"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3

- name: "Setup CodeQL"
uses: github/codeql-action/init@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1
Expand All @@ -65,7 +65,7 @@ jobs:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
egress-policy: audit

- name: "Checkout"
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
persist-credentials: false

Expand Down
25 changes: 17 additions & 8 deletions src/classes/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,27 @@ export class Server {
private initDocs(): void {
this.ELYSIA.use(
swagger({
provider: 'scalar',
scalarConfig: {
// @ts-ignore: Fetch theme directly from dist
theme: 'saturn',
layout: 'classic',
customCss: '',
isEditable: false
},
documentation: {
servers: [
{
url: 'https://jspaste.eu',
description: 'JSPaste API'
description: 'Official JSPaste instance'
},
{
url: 'https://paste.inetol.net',
description: 'Inetol Infrastructure instance'
},
{
url: 'http://localhost:'.concat(Server.PORT.toString()),
description: 'Local API (Only use if you are running an instance locally)'
description: 'Local instance (Only use if you are running the backend locally)'
}
],
info: {
Expand All @@ -79,9 +91,6 @@ export class Server {
}
}
},
swaggerOptions: {
syntaxHighlight: { activate: true, theme: 'monokai' }
},
path: Server.DOCS_PATH,
exclude: [Server.DOCS_PATH, Server.DOCS_PATH.concat('/json'), /^\/documents/]
})
Expand All @@ -90,12 +99,12 @@ export class Server {

private initCORS(): void {
const globalHeaders: Record<string, string> = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*'
'Access-Control-Allow-Origin': '*'
};

this.ELYSIA.headers(globalHeaders).options('*', ({ set }) => {
set.headers['Access-Control-Max-Age'] = (300).toString();
set.headers['Access-Control-Allow-Headers'] = '*';
set.headers['Access-Control-Max-Age'] = (3600).toString();

return new Response(null, {
status: 204
Expand Down

0 comments on commit f265e6b

Please sign in to comment.