This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
nest-app: | |
build: server | |
container_name: nest-app | |
healthcheck: | |
test: ["CMD-SHELL", "curl --silent --fail localhost:3000/api/healthcheck || exit 1"] | |
interval: 50s | |
timeout: 30s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Router from 'vue-router' | |
import Home from "@/components/Home"; | |
Vue.use(Router) | |
export default new Router({ | |
mode: 'history', | |
routes: [ | |
{ path: '/', redirect: { name: 'home' } }, | |
{ path: '/home', name: 'home', component: Home }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@babel/polyfill"; | |
import Vue from "vue"; | |
import "./plugins/boostrap-vue"; | |
import App from "./App.vue"; | |
import router from "./router"; | |
Vue.config.productionTip = false; | |
new Vue({ | |
router, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<b-container> | |
<br> | |
<b-list-group> | |
<h2 align="center">Search Movies by title</h2> | |
<b-input-group-text> | |
<b-input label="Search" type="text" v-model="search" placeholder="Search in 91,770 movies" /> | |
<span class="input-group-text">Total: {{total}}</span> | |
</b-input-group-text> | |
<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<router-view/> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue"; | |
import BootstrapVue from "bootstrap-vue"; | |
import "bootstrap/dist/css/bootstrap.min.css"; | |
import "bootstrap-vue/dist/bootstrap-vue.css"; | |
Vue.use(BootstrapVue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NestFactory } from '@nestjs/core'; | |
import { AppModule } from './app.module'; | |
import { ConfigService } from './config/config.service'; | |
async function bootstrap() { | |
const configService = new ConfigService('.env'); | |
const app = await NestFactory.create(AppModule); | |
app.enableCors(); | |
app.setGlobalPrefix(configService.get('GLOBAL_PREFIX')); | |
await app.listen(configService.get('NODE_PORT')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import { ElasticsearchService } from '@nestjs/elasticsearch'; | |
import * as moviesJson from '../../../movies.json'; | |
import { ConfigService } from '../../config/config.service'; | |
interface MoviesJsonResponse { | |
title: string; | |
year: number; | |
cast: string[]; | |
genres: string[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module, OnModuleInit } from '@nestjs/common'; | |
import { SearchService } from './search.service'; | |
import { ElasticsearchModule } from '@nestjs/elasticsearch'; | |
import { ConfigModule } from '../../config/config.module'; | |
import { ConfigService } from '../../config/config.service'; | |
@Module({ | |
imports: [ | |
ElasticsearchModule.registerAsync({ | |
imports: [ConfigModule], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import { SearchService } from '../search/search.service'; | |
@Injectable() | |
export class MovieService { | |
constructor(readonly esService: SearchService) {} | |
async findMovies(search: string = '') { | |
return await this.esService.search(search); | |
} |
NewerOlder