nstudio / xplat

Cross-platform (xplat) tools for Nx workspaces.
MIT License
366 stars 52 forks source link

How to add nestjs in electron #281

Open mkashifbaloch opened 3 years ago

mkashifbaloch commented 3 years ago

Hi Guys,

Can someone please guide me that how i can properly add nestjs application in electron.

I want create a desktop electron application which will be using angular for frontend and one local nestjs server inside electron and one external nestjs server which will not be in electron.

mkashifbaloch commented 3 years ago

currently i have added bootstrap in in electron index.ts file and then called that method from createWindow method... is that a correct way?

async function bootstrap() { const app = await NestFactory.create(AppModule); const globalPrefix = 'api'; app.setGlobalPrefix(globalPrefix); const port = process.env.PORT || 4444; await app.listen(port, () => { //Logger.log('Listening at http://localhost:' + port + '/' + globalPrefix); }); }