What is the proper project structure when creating an Angular 6 application, and an API server that share type definitions?
Example:
On the client:
this.httpService.get<Hero[]>(apiUrl + '/heroes')
On the server:
app.get('/heroes', async (req, res) => {
const heroes: Hero[] = await db.Heroes.findAll<Hero>()
res.status(200).send(heroes)
}
I need to share the Hero definition between projects.
- Do I build my server in a sub-directory of the angular app?
- Do I build my server app first, then reference its source code somehow from the Angular app?
- Do I build a third Models project, write all the definitions there, and somehow reference them?
