npm init -y
-y
completa todos los campos por default, ya que por el momento no se necesita especificar cada uno.
npm i express cors dotenv node-fetch
"type": "module"
- Necesitamos
node-fetch
para hacer la solicitudhttp
, sin embargo la librerianode-fetch
ya no utilizacommonjs
(el require). Por esto lo cambiamos a que seamodule
para poder utilizarrequire
eimport
sk-**********************************************"
Por la API keys
de OpenAI generada al hacer click en el boton:
+ Create new secrect key
node index