GithubHelp home page GithubHelp logo

node .output/server/index.mjs about chatgpt-ui HOT 5 OPEN

JuJoker avatar JuJoker commented on August 20, 2024
node .output/server/index.mjs

from chatgpt-ui.

Comments (5)

WongSaang avatar WongSaang commented on August 20, 2024

https://wongsaang.github.io/chatgpt-ui/guide/configuration.html#client-configuration

This issue is likely caused by missing environment variables. Please create a .env file in the project root directory, and then add the environment variables as mentioned in the documentation. Especially SERVER_DOMAIN, which specifies the address of your backend for the proxy to connect to.

from chatgpt-ui.

JuJoker avatar JuJoker commented on August 20, 2024

https://wongsaang.github.io/chatgpt-ui/guide/configuration.html#client-configuration

This issue is likely caused by missing environment variables. Please create a .env file in the project root directory, and then add the environment variables as mentioned in the documentation. Especially SERVER_DOMAIN, which specifies the address of your backend for the proxy to connect to.

Thank you, the .env file had been placed and the SERVER_DOMAIN were also set. If I run the yarn dev , the project can run successfully, but when i run the above node .output/server/index.mjs after bash yarn build. At the same time, when i deploy the project on the Ubuntu22.04, the .env file is not work as you mentioned. I alter the content as follows annotation
to solve this problem

import { createProxyMiddleware } from 'http-proxy-middleware'
export default defineEventHandler(async (event) => {
    await new Promise((resolve, reject) => {
        createProxyMiddleware({
            target: process.env.SERVER_DOMAIN,
            // target: "http://xxx.xxxx.xxx.1xx:8000/",
            pathFilter: '/api',
        })(event.node.req, event.node.res, (err) => {
            if (err)
                reject(err)
            else
                resolve(true)
        })
    })
})

from chatgpt-ui.

WongSaang avatar WongSaang commented on August 20, 2024

You can also define system-level environment variables so that Node can read them. Alternatively, you can prefix your command with an environment variable, for example:
MY_ENV_VAR=example_value node your_script.js

from chatgpt-ui.

JuJoker avatar JuJoker commented on August 20, 2024

You can also define system-level environment variables so that Node can read them. Alternatively, you can prefix your command with an environment variable, for example:
MY_ENV_VAR=example_value node your_script.js

Thank you, the issue was solved by define the systemctl-level environment as SERVER_DOMAIN = ipaddress:port, but the nuxt project seems cannot access the backend server , and my SERVER_DOMAIN is set 127.0.0.1:8000.
I tried to run the django project with the command python manage.py runserver 0.0.0.0:8000 also fails, and the settings is python ALLOWED_HOSTS=['*']
In the end, does the coffee can be pay with Alipay. Thank you very much.

from chatgpt-ui.

WongSaang avatar WongSaang commented on August 20, 2024

You can also define system-level environment variables so that Node can read them. Alternatively, you can prefix your command with an environment variable, for example:
MY_ENV_VAR=example_value node your_script.js

Thank you, the issue was solved by define the systemctl-level environment as SERVER_DOMAIN = ipaddress:port, but the nuxt project seems cannot access the backend server , and my SERVER_DOMAIN is set 127.0.0.1:8000. I tried to run the django project with the command python manage.py runserver 0.0.0.0:8000 also fails, and the settings is python ALLOWED_HOSTS=['*'] In the end, does the coffee can be pay with Alipay. Thank you very much.

BMC doesn't seem to support Alipay, but you can input UnionPay card information in the bank card section. If you'd like to support me, you can give it a try. Thank you!

from chatgpt-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.