This is a simple Node.js application that uses the OpenAI API to generate a short paragraph based on a given topic.
Before running the application, make sure you have the following:
- Node.js installed
- OpenAI API key (you can obtain this from the OpenAI website)
- Clone the repository:
git clone https://github.com/jmrashed/express-openapi-generator.git
- Install dependencies:
npm install
- Create a .env file in the project root and add your OpenAI API key:
API_KEY=your_openai_api_key
- Start the server:
npx nodemon index.js
- Open your browser and go to
http://localhost:3000
. - Enter a topic in the input field and click the "Generate" button.
- The server will use the OpenAI API to generate a short paragraph based on the provided topic.