switch to bun
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Hono } from "hono";
|
||||
import { serve } from "@hono/node-server";
|
||||
import loadConfiguration from "./config";
|
||||
import { DatabaseInterface } from "./database/DatabaseInterface";
|
||||
import type { DatabaseInterface } from "./database/DatabaseInterface";
|
||||
import PgDatabase from "./database/PgDatabase";
|
||||
import { setup as setupAccounts } from "./domain/account/setup";
|
||||
import { HTTPError } from "./errors";
|
||||
@@ -20,7 +19,7 @@ app.onError((err, c) => {
|
||||
return c.json({ error: "Internal server error" }, 500);
|
||||
});
|
||||
|
||||
serve({
|
||||
export default {
|
||||
port: config.port,
|
||||
fetch: app.fetch,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,8 +12,6 @@ export interface Configuration {
|
||||
}
|
||||
|
||||
export default function loadConfiguration(): Configuration {
|
||||
process.loadEnvFile();
|
||||
|
||||
return {
|
||||
database: {
|
||||
host: getUnsafeEnv("DATABASE_HOST"),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Hono } from "hono";
|
||||
import { validator } from "hono/validator";
|
||||
import { AccountServiceInterface } from "../service/AccountServiceInterface";
|
||||
import type { AccountServiceInterface } from "../service/AccountServiceInterface";
|
||||
import { loginSchema, registerSchema } from "../validation/AccountValidation";
|
||||
import { BadSchemaError } from "../../../errors";
|
||||
import { createRateLimit } from "../../../middleware/rateLimiter";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DatabaseInterface } from "../../../database/DatabaseInterface";
|
||||
import type { DatabaseInterface } from "../../../database/DatabaseInterface";
|
||||
import { AccountEntity } from "../entity/AccountEntity";
|
||||
import { AccountRepositoryInterface } from "./AccountRepositoryInterface";
|
||||
import type { AccountRepositoryInterface } from "./AccountRepositoryInterface";
|
||||
|
||||
export default class AccountRepository implements AccountRepositoryInterface {
|
||||
constructor(private readonly database: DatabaseInterface) {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AccountEntity } from "../entity/AccountEntity";
|
||||
import { AccountRepositoryInterface } from "../repository/AccountRepositoryInterface";
|
||||
import { AccountServiceInterface } from "./AccountServiceInterface";
|
||||
import type { AccountRepositoryInterface } from "../repository/AccountRepositoryInterface";
|
||||
import type { AccountServiceInterface } from "./AccountServiceInterface";
|
||||
import {
|
||||
AccountNotFoundError,
|
||||
AccountAlreadyExistsError,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Hono } from "hono";
|
||||
import { DatabaseInterface } from "../../database/DatabaseInterface";
|
||||
import type { DatabaseInterface } from "../../database/DatabaseInterface";
|
||||
import toRoutes from "./controller/AccountController";
|
||||
import AccountRepository from "./repository/AccoutRepository";
|
||||
import AccountService from "./service/AccountService";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
import type { ContentfulStatusCode } from "hono/utils/http-status";
|
||||
|
||||
export class HTTPError extends Error {
|
||||
constructor(
|
||||
|
||||
Reference in New Issue
Block a user