lenne.Tech Nest Server
The lenne.Tech Nest Server is a modern, fast, powerful node.js web framework based on nestjs.
Description
The lenne.Tech Nest Server is based on the Nest framework and can either be used
and extended as a boilerplate (git clone) or integrated as a module (npm package).
Boilerplate / npm package
Boilerplate
You can use the git repository as a template to start your new server. So you can manipulate the complete source code
of the nest server, but you have to update the core yourself.
$ git clone https://github.com/lenneTech/nest-server.git
$ cd node-server
$ npm install
npm package
A simpler and recommended variant is the integration via npm package.
$ cd YOUR-PROJECT
$ npm i @lenne.tech/nest-server
src/main.ts:
(see https://github.com/lenneTech/nest-server/tree/master/src/main.ts)
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { ServerModule } from '@lenne.tech/nest-server';
/**
* Preparations for server start
*/
async function bootstrap() {
// Create a new server based on fastify
const server = await NestFactory.create<NestExpressApplication>(
// Include server module, with all necessary modules for the project
ServerModule,
);
// Enable cors to allow requests from other domains
server.enableCors();
// Start server on configured port
await server.listen(3000);
}
// Start server
bootstrap();
Running the app
$ npm start
$ npm run start:dev
$ npm run start:prod
Test
$ npm test
$ npm run test:e2e
$ npm run test:cov