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 app = express() | |
app.get('/ping', (req, res) => { | |
const now = Date.now(), | |
day = 8.64e7 | |
// calculate midnight today and tomorrow | |
const midnight = Math.floor(now / day) * day | |
const midnightDate = new Date(midnight) |
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 fs = require('fs') | |
const readline = require('readline') | |
const { google } = require('googleapis') | |
const client_secret = require('./client_secret.json') | |
// If modifying these scopes, delete token.json. | |
const SCOPES = ['https://www.googleapis.com/auth/calendar.readonly'] | |
// The file token.json stores the user's access and refresh tokens, and is | |
// created automatically when the authorization flow completes for the first | |
// time. |
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
// server/complete.post.js | |
import { Configuration, OpenAIApi } from 'openai-edge' | |
import { OpenAIStream } from 'ai' | |
import type { H3Event } from 'h3' | |
const { OPENAI_API_KEY } = useRuntimeConfig() | |
let openai |
OlderNewer