first working prototype of shortly

This commit is contained in:
2023-01-12 21:18:49 -03:00
parent a897ec5f95
commit 856e01d339
34 changed files with 745 additions and 100 deletions

View File

@@ -0,0 +1,34 @@
import { model, Model, Schema } from 'mongoose'
export interface IUrl {
id: string
url: string
dateCreated: Date
uploadedByUser: string
}
export const urlSchema = new Schema<IUrl>(
{
id: {
type: String,
unique: true,
required: true,
},
url: {
type: String,
required: true,
},
dateCreated: {
type: Date,
default: new Date(),
required: true,
},
uploadedByUser: {
type: String,
required: true,
},
},
{ collection: 'url', timestamps: true }
)
export const UrlModel: Model<IUrl> = model('Url', urlSchema)