adds preliminary replit support

This commit is contained in:
nai-degen 2023-04-09 18:55:24 -05:00 committed by nai-degen
parent 7bb70ddfdc
commit 5bf87646eb
4 changed files with 46 additions and 0 deletions

27
.replit Normal file
View File

@ -0,0 +1,27 @@
run = "npm run start:replit"
hidden = [".build", ".config"]
[packager]
language = "nodejs"
[packager.features]
enabledForHosting = false
packageSearch = true
guessImports = true
[nix]
channel = "stable-22_11"
[gitHubImport]
requiredFiles = [".replit", "replit.nix", ".config"]
[languages]
[languages.typescript]
pattern = "**/{*.ts,*.js,*.tsx,*.jsx}"
[languages.typescript.languageServer]
start = "typescript-language-server --stdio"
[deployment]
run = ["sh", "-c", "npm run start:replit"]

9
.replit.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs }: {
deps = [
pkgs.nodejs-18_x
pkgs.yarn
pkgs.esbuild
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
];
}

View File

@ -11,6 +11,8 @@ pinned: false
Simple reverse proxy server for the OpenAI API.
[![Run on Repl.it](https://replit.com/badge/github/nai-degen/oai-reverse-proxy)](https://replit.com/new/github/nai-degen/oai-reverse-proxy)
## What is this?
If you have an API key you want to share with a friend, you can use this to keep your key safe while still allowing them to generate text with the API.
@ -51,3 +53,6 @@ If you still want to share access to your key, you can put it behind this proxy
- However, if you want to protect access to the server, you can add another secret called `PROXY_KEY`. This key will need to be passed in the Authentication header of every request to the server, just like an OpenAI API key.
**Note:** The `keys` section in the serverinfo screen may not correctly identify keys as trial/paid/GPT-4 unless you use the more advanced configuration described in `.env.example`.

View File

@ -5,8 +5,12 @@
"scripts": {
"build": "tsc",
"start:dev": "nodemon --watch src --exec ts-node src/server.ts",
"start:replit": "tsc && node build/server.js",
"start": "node build/server.js"
},
"engines": {
"node": ">=18.0.0"
},
"author": "",
"license": "MIT",
"dependencies": {
@ -14,6 +18,7 @@
"dotenv": "^16.0.3",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",
"pino": "^8.11.0",
"pino-http": "^8.3.3",
"showdown": "^2.1.0",
"zlib": "^1.0.5"