Separating jhipster back-end and front-end into two projects?

后端 未结 5 2076
春和景丽
春和景丽 2020-12-13 21:15

I\'m trying jhipster with token-based authentication. It works perfectly.

Now, I want to run back-end and front-end code on different domains. How c

5条回答
  •  伪装坚强ぢ
    2020-12-13 22:16

    Separating frontend and backend in JHipster application is quite simple. Please follow the steps mentioned below if you want to setup frontend and backend applications separately and individually using JHipster:

    1. Create two directories for frontend and backend applications

      • mkdir frontend
      • mkdir backend
    2. change your directory to frontend and run the JHipster command to create just frontend module

      • cd frontend
      • jhipster --skip-server --db=sql --auth=jwt
      • if all works fine, run npm start command to run your frontend application.

      I'm using mysql for db and JWT for auth and if you want to use websockets you add: "--websocket=spring-websocket"

    3. Now, change your directory to the backend and run JHipster command to create just backend module

      • cd .. //as we are ing backend directory currently
      • cd backend
      • jhipster --skip-client
      • Run your backend application as you run your spring boot application

    Now, your frontend and backend application are running separately and individually and frontend is coordinating with the backend application via REST API calls.

提交回复
热议问题