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 redis = require('redis'); | |
const app = express(); | |
const client = redis.createClient(); | |
app.get('/api/endpoint', (req, res) => { | |
const ipAddress = req.ip; | |
client.incr(ipAddress, (err, requestCount) => { |
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
using AutoMapper; | |
using Microsoft.AspNetCore.Mvc; | |
using Redis.OM; | |
using Redis.OM.Searching; | |
using WatchLogger.Models; | |
namespace WatchLogger.Helpers | |
{ | |
public class RedisStackHelper |
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
using WatchLogger; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); | |
builder.Services.AddWatchLoggerServices(opt => | |
{ | |
opt.SetExternalDbConnString = builder.Configuration["RedisConnectionString"]; | |
}); |
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
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.VisualBasic; | |
using Redis.OM; | |
using Redis.OM.Searching; | |
using System; | |
using WatchLogger.Helpers; | |
using WatchLogger.Models; | |
namespace WatchLogger.Controllers |
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.IO; | |
using Redis.OM; | |
using System.Runtime.InteropServices; | |
using WatchLogger.Exceptions; | |
using WatchLogger.Helpers; | |
using WatchLogger.HostedService; |
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.Extensions.DependencyInjection; | |
using Redis.OM; | |
using System.Runtime.InteropServices; | |
using WatchLogger.Exceptions; | |
using WatchLogger.Helpers; | |
using WatchLogger.HostedService; | |
namespace WatchLogger | |
{ |
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
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
using Redis.OM; | |
using WatchLogger.Helpers; | |
namespace WatchLogger.HostedService | |
{ | |
public class IndexCreationService : BackgroundService |
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
using Redis.OM.Modeling; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace WatchLogger.Models | |
{ | |
[Document(StorageType = StorageType.Json, Prefixes = new[] { "WLog" })] |
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
'use strict'; | |
const e = React.createElement; | |
class MediumPost extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
error: null, | |
isLoaded: false, |
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 functions = require('firebase-functions'); | |
const express = require('express'); | |
const path = require('path'); | |
// The Firebase Admin SDK to access the Firebase Realtime Database. | |
const admin = require('firebase-admin'); | |
admin.initializeApp() | |
/* This function may break now*/ | |
// exports.onUserCreated = functions.firestore.collection("users").onCreate((change, context)=>{ | |
// return console.log(change); |
NewerOlder