elyorman / exaggerate

A NestJS project to call a Python image manipulation script.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exaggerate

This is a NestJS project to call a Python image manipulation script.

Workflow

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

Starting out

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

Original readme

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

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.

Stay in touch

License

Nest is MIT licensed.

About

A NestJS project to call a Python image manipulation script.


Languages

Language:TypeScript 89.5%Language:JavaScript 10.5%