mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 15:27:49 +01:00
add (empty) photos routes
This commit is contained in:
@@ -12,6 +12,7 @@ import * as serve from "koa-static";
|
||||
import { config, EnvType } from "~config";
|
||||
import { userRouter } from "~routes/users";
|
||||
import { devRouter } from "~routes/dev";
|
||||
import { photosRouter } from "~routes/photos";
|
||||
|
||||
export const app = new Koa();
|
||||
|
||||
@@ -45,6 +46,7 @@ app.use(async (ctx, next) => {
|
||||
app.use(serve("frontend/dist"));
|
||||
|
||||
app.use(userRouter.routes()).use(userRouter.allowedMethods());
|
||||
app.use(photosRouter.routes()).use(photosRouter.allowedMethods());
|
||||
|
||||
if (config.env === EnvType.development) {
|
||||
app.use(devRouter.routes()).use(devRouter.allowedMethods());
|
||||
|
||||
17
src/entity/Photo.ts
Normal file
17
src/entity/Photo.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
BaseEntity,
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
PrimaryGeneratedColumn,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class Photo extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
public id: number;
|
||||
|
||||
@Column({ length: 190 })
|
||||
@Index()
|
||||
public hash: string;
|
||||
}
|
||||
3
src/routes/photos.ts
Normal file
3
src/routes/photos.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as Router from "koa-router";
|
||||
|
||||
export const photosRouter = new Router();
|
||||
Reference in New Issue
Block a user