Skip to content

ryan81g/next-express-openai

Repository files navigation

This is a Next.js project that uses express as a custom server. The server file is located at the root as server.js.

Getting Started

First, install dependencies:

npm install 

Add your OpenAI API key to the .env file at root.

Next run

npm run dev-server 

This will start the express server and the next app.

Open http://localhost:3000 with your browser to see the result.

There are two versions usage of the api from the custom server, a server-side rendered component that lives at http://localhost:3000/server-side and the homepage that uses a client-side component.

You can learn more about data fetching here: Next Data Fetching Documentation

Within the server directory, you can update the service code that interacts with openai.

You can start editing the page by modifying app/page.js. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published