Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AISecurityGuard/demo-node-api-application

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pillar Security Worked API Example

This is a simple node-express API application to interact with OpenAI.

Getting Started

  1. Clone the repository.
  2. npm install
  3. Copy the .env.template to a .env file; add your credentials.
  4. Run node --env-file=.env index.js to start the server.

You can interact with the server using Postman or any other favorite API client (e.g., cURL). To test the API, execute a POST request to http://localhost:8080/interact.

The request should have a body in the following format:

{
  "prompt": "Here is some user input that will be sent to OpenAI."
}

Using cURL, this could look like this:

curl -X POST \
-H "Content-Type: application/json" \
-d '{"prompt": "Here is some user input that will be sent to OpenAI."}' \
http://localhost:8080/interact

About

Node.js Express API with OpenAI integration

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%