search

Home  >  Q&A  >  body text

javascript - Can I write the backend interface directly using node to realize the separation of front and back ends? Is this appropriate?

Bi She plans to do a project like this. I am not very familiar with node, but I feel that the node projects I see all directly render the front-end page. I wonder if this is possible?

巴扎黑巴扎黑2838 days ago634

reply all(4)I'll reply

  • PHPz

    PHPz2017-05-16 13:45:58

    Nodejs makes API, this is definitely possible,

    But it depends on the product,

    The advantage of nodejs is high concurrency and high IO, but it is not good at high operations,

    Of course you can do it even if you are not good at it, but the performance is not as good as php+nginx

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:45:58

    It’s absolutely possible, it’s just like writing an interface in Java, open the interface and then transmit it via json

    reply
    0
  • PHPz

    PHPz2017-05-16 13:45:58

    Yes, you can use Nodejs+MongoDB+vue+ElementUI, separate the front-end and back-end, and use asynchronous requests to obtain data, which is very convenient.

    reply
    0
  • 为情所困

    为情所困2017-05-16 13:45:58

    Yes, it is simple and convenient to write interfaces through nodejs. You can first learn the express framework (simple), and then learn promises or koa after understanding the principles and general structure.

    reply
    0
  • Cancelreply