简体   繁体   中英

Is possible to combine rest-api and angular profiles on Grails?

I'm going to start a new project that has two front ends, a mobile APP and a Web Application.

I was thinking about creating a "rest-api" grails application and consume this "api" from the mobile apps.

But, for the WebApp, is it possible to create a new "angular" Grails app that uses as model the previously generated "rest-api" Grails application and ovoids me to "re-implement the wheel (model)"?

Any articles/documentation how that could be accomplish?

Thanks in advance.

JD Evora

You can use the domain you already have in the new rest api, nothing changes. You may want to add the @Resource annotations.

If there is another app that uses this same domain, I would put in a plugin(as @Joshua suggested), we currently do it for clients which have both admin/cms and final user applications.

In our company,we are currently developing 3 projects with an idea I believe will fit well to your needs, or may help someone else who is starting a similar project

We organized the apps this way:

  • We've created a grails app with rest-api profile
  • We've created a grunt/bower/npm project(you could use yoo angular generator , but It had more than we needed)
  • We've created an android and and ios apps

Advantages we've seen:

  • The angular application calls the same methods as the mobile apps, there is only one controller, one service, one grails app

  • The web apps is pure JS and CSS and runs smoothly in the serve( npm install serve )

  • You can deploy the web app in any CDN like Amazon Cloud Front and be able to handle a big demand, and you can deploy it quickly

Just in case you don't know, but with grunt and bower you can replace assets pipeline automation.

Hope it helps you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM