Skip to content

Instantly share code, notes, and snippets.

View ChrisCates's full-sized avatar

Chris Cates ChrisCates

View GitHub Profile
@ChrisCates
ChrisCates / server.ts
Created January 26, 2024 00:41
Vercel Configuration for Typescript Express Servers
import 'colors'
import { config } from 'dotenv'
import { createServer } from 'http'
import morgan from 'morgan'
import cors from 'cors'
import Express from 'express'
import BodyParser from 'body-parser'
import { testRoute } from 'api/route/test'
config()

Keybase proof

I hereby claim:

  • I am chriscates on github.
  • I am chriscates (https://keybase.io/chriscates) on keybase.
  • I have a public key ASBOT-1eXYzfKWUgP6sM0cfHdkJMZRNCn9VyEuiT9xCH8wo

To claim this, I am signing this object:

std::vector<std::string> list = hiredisx::list("list", 0, -1, "L");
std::cout << "The first element of the list should be " << list[0] << std::endl;
// Should print, "The first element of the list should be item"
if (hiredisx::push("list", "item", "R") {
std::cout << "item has been pushed to thelist." << std::endl;
} else {
std::cout << "item had a problem being pushed to the list." << std::endl;
}
if (hiredisx::del("foo")) {
std::cout << "key foo has been deleted." << std::endl;
} else {
std::cout << "key foo had a problem being deleted." << std::endl;
}
std::string foo = hiredisx::get("bar");
std::cout << "Foo should be " << foo << std::endl; //Will print Foo should be bar.
if (hiredisx::set("foo", "bar") {
std::cout << "key foo has been set." << std::endl;
} else {
std::cout << "key foo had a problem being set." << std::endl;
}
bool available = hiredisx::test::connect();
if (available) {
// You can start using hiredisx
} else {
// Reconfigure your settings or retry
}
// include header
#include "hiredisx.hpp"
// Default options
hiredisx::options::host = "localhost";
hiredisx::options::port = 6379;
hiredisx::options::timeoutS = 5; // Timeout in seconds
hiredisx::options::timeoutNS = 0; // Timeout in nanoseconds
IF (NOT HIREDIS_LIBRARIES)
MESSAGE("-- Setting default Hiredis Library Directory")
SET(HIREDIS_LIBRARIES "/usr/local/lib/libhiredis.a")
ENDIF (NOT HIREDIS_LIBRARIES)
MESSAGE("-- HIREDIS_LIBRARIES\t" ${HIREDIS_LIBRARIES})
IF (NOT HIREDIS_INCLUDE_DIRS)
MESSAGE("-- Setting default Hiredis Include Directory")
SET(HIREDIS_INCLUDE_DIRS "/usr/local/include/hiredis")