diff --git a/packages/node/src/generators/application/files/connect/main.ts__tmpl__ b/packages/node/src/generators/application/files/connect/main.ts__tmpl__ new file mode 100644 index 00000000000000..0f880f4900f138 --- /dev/null +++ b/packages/node/src/generators/application/files/connect/main.ts__tmpl__ @@ -0,0 +1,11 @@ +import connect from 'connect'; + +const app = connect(); + +app.use((req, res) => { + res.end('Hello from Nrwl API!'); +}); + +app.listen(<%= port %>, () => { + // Server is running +}) \ No newline at end of file diff --git a/packages/node/src/generators/application/files/fastify/main.ts__tmpl__ b/packages/node/src/generators/application/files/fastify/main.ts__tmpl__ new file mode 100644 index 00000000000000..d8467729f5c477 --- /dev/null +++ b/packages/node/src/generators/application/files/fastify/main.ts__tmpl__ @@ -0,0 +1,18 @@ +import fastify from 'fastify'; + +const app = fastify(); + +app.get('/', async (req, res) => { + return 'Hello from Nrwl API!' +}); + +const start = async() => { + try { + await app.listen({ port: <%= port %> }) + } catch (err) { + // Errors are logged here + process.exit(1); + } +} + +start(); \ No newline at end of file diff --git a/packages/node/src/generators/application/files/koa/main.ts__tmpl__ b/packages/node/src/generators/application/files/koa/main.ts__tmpl__ new file mode 100644 index 00000000000000..0aa34ab1630f71 --- /dev/null +++ b/packages/node/src/generators/application/files/koa/main.ts__tmpl__ @@ -0,0 +1,11 @@ +import koa from 'koa'; + +const app = new koa(); + +app.use(async ctx =>{ + ctx.body = 'Hello from Nrwl 🐳 API'; +}); + +app.listen(<%= port %>, () => { + // Server is running +}); \ No newline at end of file