Skip to content

A basic Typescript Express server setup powered by Openai.

License

Notifications You must be signed in to change notification settings

Banhawy/openai-ts-expressjs

 
 

Repository files navigation

TypScript X Express x Openai

This is a basic TypeScript Express application that utilizes Node.js for server-side functionality and integrates with Openai. It is configured with Nodemon for automatic server restarts during development and uses ts-node for TypeScript execution.

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/c99rahul/ts-node-express.git
  1. Navigate to the project directory:
cd openai-ts-expressjs
  1. Install the project dependencies:
pnpm install
  1. Create a .env file in the root of the project and add your Openai API key:
OPENAI_API_KEY=your-api-key-here

Usage

To start the server in development, run the following command:

pnpm dev

The server will be available at http://localhost:4000.

Project structure:

.
├── src
│   ├── controllers
│   │   └── chat.ts
│   ├── routes
│   │   └── index.ts
│   └── index.ts 
├── .env
├── .gitignore
├── config.json
├── package.json
├── pnpm-lock.yaml
├── README.md
└── tsconfig.json

License

This project is open source and available under the MIT License.

About

A basic Typescript Express server setup powered by Openai.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%