J
J
Jmango NO2021-05-22 12:57:28
Express.js
Jmango NO, 2021-05-22 12:57:28

What if nuxt only handles requests that come from localhost?

Hello. I recently started making my mini chat with nuxt vue express and socketio. I decided at the development stage to check the work from a smartphone. When you try to connect to the program from a phone or another PC, the request (sent from another PC) is not processed. Can you suggest what and where to change and what to prescribe where.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2021-05-22
@Jmango

Devserver specifically locks to the localhost by default, so that someone does not decide to put it on the Internet. It can be changed here .

nuxt.config.js

export default {
  server: {
    host: '0.0.0.0' 
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question