Skip to content

Commit

Permalink
feat: implement org creation (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
levansuper authored Mar 8, 2023
1 parent dad08af commit bae01c6
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 13 deletions.
81 changes: 71 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
"dependencies": {
"@fastify/mongodb": "^6.2.0",
"@fastify/routes": "^5.1.0",
"@fastify/type-provider-json-schema-to-ts": "^2.2.2",
"@relaycorp/pino-cloud": "^1.0.28",
"env-var": "^7.3.0",
"fastify": "^4.14.0",
"fastify-plugin": "^4.5.0",
"is-valid-domain": "^0.1.6",
"json-schema-to-ts": "^2.7.2",
"mongoose": "^7.0.0",
"pino": "^8.11.0"
},
Expand Down
13 changes: 13 additions & 0 deletions src/services/fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import fastifyMongodb from '@fastify/mongodb';
import env from 'env-var';
import {
fastify,
type FastifyBaseLogger,
type RawReplyDefaultExpression,
type RawRequestDefaultExpression,
type RawServerDefault,
type FastifyInstance,
type FastifyPluginCallback,
type FastifyPluginOptions,
type HTTPMethods,
} from 'fastify';
import type { Logger } from 'pino';
import type { JsonSchemaToTsProvider } from '@fastify/type-provider-json-schema-to-ts';

import { configureExitHandling } from '../utilities/exitHandling.js';
import { makeLogger } from '../utilities/logging.js';
Expand All @@ -26,6 +31,14 @@ export const HTTP_METHODS: readonly HTTPMethods[] = [
'OPTIONS',
];

export type FastifyTypedInstance = FastifyInstance<
RawServerDefault,
RawRequestDefaultExpression,
RawReplyDefaultExpression,
FastifyBaseLogger,
JsonSchemaToTsProvider
>;

/**
* Initialize a Fastify server instance.
*
Expand Down
1 change: 1 addition & 0 deletions src/services/http.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const HTTP_STATUS_CODES = {
OK: 200,
NO_CONTENT: 204,
BAD_REQUEST: 400,
NOT_FOUND: 404,
METHOD_NOT_ALLOWED: 405,
} as const;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { makeServer } from '../server.js';
import { configureMockEnvVars, REQUIRED_SERVER_ENV_VARS } from '../../testUtils/envVars.js';

describe('healthcheck', () => {
describe('healthcheck routes', () => {
configureMockEnvVars(REQUIRED_SERVER_ENV_VARS);

test('A plain simple HEAD request should provide some diagnostic information', async () => {
Expand Down
File renamed without changes.
Loading

0 comments on commit bae01c6

Please sign in to comment.