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
const mongoose = require("mongoose"); | |
const TrainingSchema = new mongoose.Schema({ | |
input: [Number, Number, Number], | |
output: [Number] | |
}); | |
module.exports = Train = mongoose.model("trainingdatas", TrainingSchema); |
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
OAUTH_TOKEN=/*copy/paste the CONTENTS OF YOUTUBE-NODEJS-QUICKSTART.JSON FILE as it is in json format*/ | |
CLIENT_SECRET=/*copy/paste the CONTENTS OF CLIENT_SECRET.JSON FILE as it is in json format*/ | |
VIDEO_ID=your video Id |
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
let cron = require('node-cron') | |
let shell = require('shelljs') | |
var express = require('express') | |
var app = express() | |
app.get('/', function(req, res) { | |
res.redirect("https://www.youtube.com/watch?v=wYOA4waoWog") | |
}) | |
cron.schedule("8 17,25,34,42,51,59 * * * *", function() { |
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
require('dotenv').config() | |
var { | |
} = require('googleapis'); | |
var OAuth2 = google.auth.OAuth2; | |
const VIDEO_ID = process.env.VIDEO_ID | |
//main() | |
async function main() { |
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
const express = require("express"); | |
const router = express.Router(); | |
var Fruits = require('../../model/fruits.js') | |
/** | |
* @swagger | |
* /api/fruits: | |
* get: | |
* tags: | |
* - Fruits |
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
/** | |
* @swagger | |
* /api/fruits: | |
* get: | |
* tags: | |
* - Fruits | |
* description: Returns all fruits | |
* produces: | |
* - application/json | |
* responses: |
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
const swaggerOptions = { | |
swaggerDefinition: { | |
info: { | |
title: "Documenting REST API's", | |
description: "This is an implementation of how to document your RESTful API's using SWAGGER", | |
servers: ['http://localhost:3000'] | |
}, | |
"components": { | |
"schemas": { | |
"fruits": { |
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
require('./config/config') | |
const express = require('express') | |
const mongoose = require('mongoose'); | |
mongoose.set('useFindAndModify', false); | |
const app = express() | |
const bodyParser = require('body-parser') | |
const swaggerJsonDoc = require('swagger-jsdoc') | |
const swaggerUI = require('swagger-ui-express') |
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
const mongoose = require("mongoose"); | |
const fruitsSchema = new mongoose.Schema({ | |
name: { | |
type: String | |
} | |
}); | |
module.exports = fruits = mongoose.model("fruits", fruitsSchema) |
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
<html> | |
<head> | |
<title>Reports</title> | |
<!-- jQuery --> | |
https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
<!-- Bootstrap --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js | |
<!-- Datepicker --> | |
<link href='bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' rel='stylesheet' type='text/css'> |