Skip to content

Commit

Permalink
Added /metadata
Browse files Browse the repository at this point in the history
Fixed build:docs entry point
Changed prettier path from src to .
Added .dev.vars to .gitignore
Formatting
  • Loading branch information
james-pre committed Feb 2, 2024
1 parent 81c0bb0 commit 6009690
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ docs
.env*
.wrangler
*.log
#temporaries
.dev.vars
tmp
temp
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{
}
{}
10 changes: 9 additions & 1 deletion functions/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ import { StatusCodes } from 'http-status-codes';
import { setDB } from '../src/backend/api';
import type { RequestContext } from '../src/backend/context';
import { error, response } from '../src/backend/utils';
import { version } from '../package.json';

export async function onRequest({ env }: RequestContext) {
try {
setDB(env.DB);
return response(StatusCodes.OK, {}, false);
return response(
StatusCodes.OK,
{
version,
debug: !!env.DEBUG,
},
false
);
} catch (e) {
console.error(e);
return error(StatusCodes.INTERNAL_SERVER_ERROR, env.DEBUG && e?.message);
Expand Down
1 change: 0 additions & 1 deletion license.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ The licensor reserve's the right to take down any content at their discretion.

The licensor might make upgrades, updates or patches (collectivly "updates") available from time to time, but they don't have to. they are also not obliged to provide ongoing support or maintenance of any Game. With updates come changes that might not work well with other software, such as Mods. This is unfortunate, but it is something the licensor does not take responsibility for.


## Warranty and Liability

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"license.md"
],
"scripts": {
"format:check": "prettier --check src",
"format": "prettier --write src",
"format:check": "prettier --check .",
"format": "prettier --write .",
"lint": "eslint src functions && tsc --project tsconfig.json --noEmit",
"build:frontend": "node scripts/build.js",
"build:docs": "typedoc src/index.ts --includeVersion --readme readme.md --darkHighlightTheme monokai --lightHighlightTheme monokai",
"build:docs": "typedoc src/frontend/index.ts --includeVersion --readme readme.md --darkHighlightTheme monokai --lightHighlightTheme monokai",
"prepublishOnly": "npm run build:frontend",
"dev": "wrangler pages dev public --compatibility-flags='nodejs_compat' --ip localhost"
},
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Blankstorm API

This is the code for Blankstorm's REST API.
This is the code for Blankstorm's REST API.

# @blankstorm/api
### @blankstorm/api

This is the client-side library. It provides typings and convience functions.

Expand All @@ -26,4 +26,4 @@ auth(authToken);
const { id } = await getAccount('token', authToken);

await logout(id);
```
```
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"noEmit": true,
"esModuleInterop": true,
"allowJs": true,
"strictFunctionTypes": true
}
"strictFunctionTypes": true,
},
}

0 comments on commit 6009690

Please sign in to comment.