Variables
Const API_GIT_URL
API_GIT_URL: "https://github.com/rnegron/cc-api" = "https://github.com/rnegron/cc-api"
Const API_URL
API_URL: "" = ""
Const ActorModel
Actor
Model: IActorModel = mongoose.model<IActor, IActorModel>('Actor', ActorSchema)
Const ActorSchema
ActorSchema: Schema<any> = new mongoose.Schema({__v: { type: Number, select: false },name: { type: String },})
Const CC_URL
CC_URL: "https://caribbeancinemas.com" = "https://caribbeancinemas.com"
Const MovieModel
Movie
Model: IMovieModel = mongoose.model<IMovie, IMovieModel>('Movie',MovieSchema)
Const MovieRunsModel
Movie
RunsModel: IMovieRunModel = mongoose.model<IMovieRun, IMovieRunModel>('movierun',MovieRunsSchema)
Const MovieRunsSchema
MovieRunsSchema: Schema<any> = new mongoose.Schema({__v: { type: Number, select: false },type: { type: String, default: 'Normal' },language: { type: String, default: 'Spanish' },subtitles: { type: String, default: null },'3d': { type: Boolean, default: false },showTimes: {'Mon-Thu': [Date],'Mon-Fri': [Date],Friday: [Date],Saturday: [Date],Sunday: [Date],},})
Const MovieSchema
MovieSchema: Schema<any> = new mongoose.Schema({__v: { type: Number, select: false },movieId: { type: String, unique: true },title: { type: String, index: true },genre: { type: [String] },rating: { type: String },runtime: { type: Number },synopsis: { type: String },releaseDate: { type: Date },nowShowing: { type: Boolean },staring: { type: [ActorSchema] },})
Const TheatreModel
Theatre
Model: ITheatreModel = mongoose.model<ITheatre, ITheatreModel>('Theatre',TheatreSchema)
Const TheatreSchema
TheatreSchema: Schema<any> = new mongoose.Schema({__v: { type: Number, select: false },name: { type: String },slug: { type: String, unique: true },city: { type: String },address: { type: String },phone: { type: String },amenities: {cxc: { type: Boolean, default: false },imax: { type: Boolean, default: false },'3d': { type: Boolean, default: false },'4dx': { type: Boolean, default: false },atm: { type: Boolean, default: false },accessible: { type: Boolean, default: false },partyRoom: { type: Boolean, default: false },gameRoom: { type: Boolean, default: false },stadiumTheatre: { type: Boolean, default: false },powerGenerator: { type: Boolean, default: false },},runs: { type: [MovieRunsSchema] },})
Const cli
cli: Result = meow(`Usage$ ts-node src/tasksOptions--now-showing, --now Scrape movies now showing--coming-soon, --soon Scrape movies coming soon--save, Store results in MongoDBExamples$ ts-node src/tasks --now --save`,{flags: {nowShowing: {type: 'boolean',alias: 'now',},comingSoon: {type: 'boolean',alias: 'soon',},save: {type: 'boolean',},},})
Const database
database: string = process.env.DATABASE_NAME || 'cc-api'
Const dbUrl
dbUrl: undefined | string = process.env.NODE_ENV === 'production'? process.env.PRODUCTION_DB_URI: `mongodb://${host}:${port}/${database}`
Const fakeNowShowing
fakeNowShowing: any = require('../../tests/data/now-showing.json')
Const host
host: string = process.env.DATABASE_HOST || 'localhost'
Const instance
instance: AxiosInstance = axios.create({baseURL: CC_URL,headers: { 'X-CC-API': API_GIT_URL },})
Let plugins
plugins: any[] = [require('@hapi/inert'),require('@hapi/vision'),jsonApiEnforcer,logger,version,]
Const port
port: string = process.env.DATABASE_PORT || '27017'
Const routes
routes: (object | object | object | object)[] = [...nowShowingRoutes,...theatreRoutes,...comingSoonRoutes,...movieRoutes,...movieRunRoutes,]
Obtains the subtitle language from a text which may contain it.