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 app = require('express')(); | |
const server = require('http').createServer(app); | |
const cors = require('cors'); | |
// configure socket.io to allow cross-origin requests | |
const io = require('socket.io')(server, { cors: { origin: '*' } }); | |
// set up our PORT | |
const MY_PREFERRED_PORT = 8000; | |
const PORT = process.env.PORT || MY_PREFERRED_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 NextAuth from 'next-auth'; | |
import GithubProvider from 'next-auth/providers/github'; | |
import Credentials from 'next-auth/providers/credentials'; | |
import bcrypt from 'bcrypt'; | |
import { getXataClient } from '../../../utils/xata'; | |
const xata = getXataClient(); | |
export const authOptions = { | |
session: { |
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 { signIn, getCsrfToken, getProviders } from 'next-auth/react'; | |
import { RiGithubLine } from 'react-icons/ri'; | |
import Link from 'next/link'; | |
import { useState } from 'react'; | |
import { useRouter } from 'next/router'; | |
import { toast } from 'react-toastify'; | |
import Loading from '../../components/Loading'; | |
export default function SignIn({ csrfToken, providers }) { | |
const router = useRouter(); |
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 { signIn, getProviders } from 'next-auth/react'; | |
import { RiGithubLine } from 'react-icons/ri'; | |
import Link from 'next/link'; | |
import { useState } from 'react'; | |
import { useRouter } from 'next/router'; | |
import { toast } from 'react-toastify'; | |
import Loading from '../../components/Loading'; | |
export default function SignIn({ providers }) { | |
const router = useRouter(); |
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 nc from 'next-connect'; | |
import { getToken } from 'next-auth/jwt'; | |
import multer from 'multer'; | |
import path from 'path'; | |
import DatauriParser from 'datauri/parser'; | |
import cloudinary from '../../utils/cloudinary'; | |
import { getXataClient } from '../../utils/xata'; | |
const xata = getXataClient(); |
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 nc from 'next-connect'; | |
import { getToken } from 'next-auth/jwt'; | |
import multer from 'multer'; | |
import path from 'path'; | |
import DatauriParser from 'datauri/parser'; | |
import cloudinary from '../../utils/cloudinary'; | |
import { getXataClient } from '../../utils/xata'; | |
const handler = nc({ | |
onError: (err, res) => { |
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 nc from 'next-connect'; | |
import { getToken } from 'next-auth/jwt'; | |
import multer from 'multer'; | |
import path from 'path'; | |
import DatauriParser from 'datauri/parser'; | |
import cloudinary from '../../utils/cloudinary'; | |
import { getXataClient } from '../../utils/xata'; | |
const handler = nc({ | |
onError: (err, res) => { |
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 React, { useState, useEffect } from 'react'; | |
import { useSession } from 'next-auth/react'; | |
import { useRouter } from 'next/router'; | |
import { toast } from 'react-toastify'; | |
import { getXataClient } from '../utils/xata'; | |
import SkeletonLoader from '../components/SkeletonLoader'; | |
import 'react-quill/dist/quill.snow.css'; | |
import 'react-quill/dist/quill.bubble.css'; | |
import { modules, formats } from '../utils/editor'; | |
import ErrorComponent from '../components/ErrorComponent'; |
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
// Generated by Xata Codegen 0.18.0. Please do not edit. | |
import { buildClient } from '@xata.io/client'; | |
/** @typedef { import('./types').SchemaTables } SchemaTables */ | |
/** @type { SchemaTables } */ | |
const tables = [ | |
{ | |
name: 'Users', | |
columns: [ | |
{ name: 'username', type: 'string', unique: true }, | |
{ name: 'email', type: 'email', unique: true }, |
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 cloudinary from "cloudinary"; | |
cloudinary.v2.config({ | |
cloud_name: process.env.CLOUDINARY_NAME, | |
api_key: process.env.CLOUDINARY_API_KEY, | |
api_secret: process.env.CLOUDINARY_API_SECRET | |
}) | |
export default cloudinary |
OlderNewer