Code Monkey home page Code Monkey logo

Comments (9)

hyrious avatar hyrious commented on August 16, 2024

See #796.

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

Are there alternative solutions aside from the utilization of Docker?

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

If I use Docker, is there any change at this position in https://github.com/netless-io/flat-server/blob/main/scripts/prepare-test-env.sh?
Screenshot 2024-04-11 210517

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

Because my knowledge in this area is quite limited, could you please clarify for me?
Sorry for any inconvenience I may have caused and thank you very much for your support.

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

Is the command to run like this?
wget -O - https://github.com/netless-io/flat-server/raw/main/scripts/prepare-test-env.sh | sh
docker run --name mysql-db -e MYSQL_ROOT_PASSWORD=your_password -d mysql:latest
docker run --name redis-db -d redis:latest
yarn run test:sync:orm

from flat-server.

hyrious avatar hyrious commented on August 16, 2024

It doesn't need to be docker of course. The code of flat-server has to connect to a mysql service and a redis service. It will read config/development.local.yaml or config/production.local.yaml (depending on the env NODE_ENV) at runtime and connect to these services, see

redis:
host: 127.0.0.1
port: 7528
username:
password: flat-server-test
db: 0
queueDB: 1
mysql:
host: 127.0.0.1
port: 7519
username: root
password: flat-server-test
db: flat_server
.

So you just have to make sure the services are there, and that's enough. The test:sync:orm script will create database tables for you.

Once you have prepared the databases, you can start running the server with:

# watch build the server, will generate dist/index.js
$ yarn run start

# start server in another terminal
$ node dist/index.js

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

Thanks for your support. I will try it.

from flat-server.

zerohct avatar zerohct commented on August 16, 2024

Could you please tell me why when I use 'yarn run start' and 'node ./dist/index.js' with port 8080, even though it displays as running successfully but the link doesn't work?
image
image

from flat-server.

hyrious avatar hyrious commented on August 16, 2024

0.0.0.0 is not a valid address to connect to (ERR_ADDRESS_INVALID). It means that the server listens to all possible addresses that could reach the server. For example localhost 127.0.0.1 192.168.x.y {your internet ip}. You can just use 127.0.0.1.

from flat-server.

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.