A powerful Express middleware for generating creative character names inspired by popular franchises using OpenAI's GPT model. Provided by Stargazer.
npm install franchise-name-generator
- Generate fantasy names inspired by popular franchises
- Supported franchises: Marvel, DC, Star Wars, Lord of the Rings, Game of Thrones
- Random option for general fantasy names
- Rate limiting included
- CORS enabled
const express = require('express');
const createFranchiseNameGenerator = require('franchise-name-generator');
const app = express();
const OPENAI_API_KEY = 'your-api-key-here';
app.use('/names', createFranchiseNameGenerator(OPENAI_API_KEY));
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
Send a POST request to /names
with the following body:
{
"franchise": "marvel", // or "dc", "starwars", "lotr", "got", "random"
"token": "unique-user-token"
}
The response will contain an array of generated character names.
{
"characterNames": {
"character_names": [
"Quantum Striker",
"Nova Phoenix",
"Iron Thunder",
"Cosmic Wraith",
"Shadow Pulse"
]
}
}
The middleware includes basic rate limiting:
- Maximum 10 requests per token
- Requests are tracked per user token
This package requires a valid OpenAI API key. Make sure to keep your API key secure and never expose it in your code.
fantasy, names, generator, franchise, marvel, dc, starwars, got, lotr, openai, gpt