This file contains hidden or 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 token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" | |
| console.log(atob(token.split(".")[1])) |
This file contains hidden or 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 MongoClient = require('mongodb').MongoClient; | |
| exports.handler = async (event, context) => { | |
| const { sub: userId } = event.request.userAttributes; | |
| const uri = '<your-mongodb-uri>'; | |
| const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true }); | |
| try { | |
| await client.connect(); | |
| const database = client.db('<your-db-name>'); |
This file contains hidden or 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 } from "react"; | |
| import RecordRTC from "recordrtc"; | |
| function VideoRecorder() { | |
| const [recordRTC, setRecordRTC] = useState(null); | |
| const [stream, setStream] = useState(null); | |
| const startRecording = () => { | |
| navigator.mediaDevices | |
| .getUserMedia({ video: true, audio: true }) |
This file contains hidden or 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
| router.get('/allpost',JWTAuthenticatToken, async (req, res) => { | |
| try{ | |
| const post = await Post.find()..skip((page_size * page_number)-page_size)).limit(page_size) | |
| res.json(post) | |
| }catch(error){ | |
| res.json({message:error}) | |
| } | |
| }) |