This is a NestJS project to call a Python image manipulation script.
npm install # run the first time the repo is cloned
npm run start
npm run start:dev # watch mode
npm run start:prod
npm run test # unit tests
npm run test:e2e # e2e tests
npm run test:cov # test coverage
Theses were the scaffolding commands used to create this project:
>npm i -g @nestjs/cli
...
>nest new exaggerate
...
>cd exaggerate
>nest g resource elaborate
? What transport layer do you use? REST API
? Would you like to generate CRUD entry points? Yes
CREATE src/elaborate/elaborate.controller.ts (988 bytes)
CREATE src/elaborate/elaborate.controller.spec.ts (606 bytes)
CREATE src/elaborate/elaborate.module.ts (275 bytes)
CREATE src/elaborate/elaborate.service.ts (677 bytes)
CREATE src/elaborate/elaborate.service.spec.ts (481 bytes)
CREATE src/elaborate/dto/create-elaborate.dto.ts (35 bytes)
CREATE src/elaborate/dto/update-elaborate.dto.ts (189 bytes)
CREATE src/elaborate/entities/elaborate.entity.ts (26 bytes)
UPDATE package.json (2028 bytes)
UPDATE src/app.module.ts (328 bytes)
√ Packages installed successfully.
elaborate
Test the app by doing npm run start and going to http://localhost:3333/
After this, the main.ts was modified to add a logger, a global prefix and report the url and port that app is listening on:
import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const globalPrefix = 'api';
const port = process.env.PORT || 3333;
await app.listen(port, () => {
Logger.log('Listening at http://localhost:' + port + '/' + globalPrefix);
});
}
bootstrap();
However, with these changes, the app is still only working without the global prefix:
http://localhost:3333/elaborate
A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.