Skip to content
Snippets Groups Projects
Commit 1acbe4ff authored by axel huillard's avatar axel huillard
Browse files

ajout de la base du serveur

parent 7cbcbd49
Branches base_serveur
No related tags found
No related merge requests found
...@@ -2,20 +2,20 @@ module.exports = { ...@@ -2,20 +2,20 @@ module.exports = {
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
project: 'tsconfig.json', project: 'tsconfig.json',
tsconfigRootDir : __dirname,
sourceType: 'module', sourceType: 'module',
}, },
plugins: ['@typescript-eslint/eslint-plugin'], plugins: ['@typescript-eslint/eslint-plugin'],
extends: [ extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'prettier', 'plugin:prettier/recommended',
'prettier/@typescript-eslint',
], ],
root: true, root: true,
env: { env: {
node: true, node: true,
jest: true, jest: true,
}, },
ignorePatterns: ['.eslintrc.js'],
rules: { rules: {
'@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-function-return-type': 'off',
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
logs logs
*.log *.log
npm-debug.log* npm-debug.log*
pnpm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
lerna-debug.log* lerna-debug.log*
......
<p align="center"> <p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p> </p>
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[travis-url]: https://travis-ci.org/nestjs/nest [circleci-url]: https://circleci.com/gh/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
<p align="center"> <p align="center">
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a> <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a> <a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a> <a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a> <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a> <a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a> <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p> </p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--> [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
...@@ -72,4 +70,4 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors ...@@ -72,4 +70,4 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
## License ## License
Nest is [MIT licensed](LICENSE). Nest is [MIT licensed](LICENSE).
{ {
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics", "collection": "@nestjs/schematics",
"sourceRoot": "src" "sourceRoot": "src"
} }
This diff is collapsed.
...@@ -21,34 +21,35 @@ ...@@ -21,34 +21,35 @@
"test:e2e": "jest --config ./test/jest-e2e.json" "test:e2e": "jest --config ./test/jest-e2e.json"
}, },
"dependencies": { "dependencies": {
"@nestjs/common": "^7.0.0", "@nestjs/common": "^8.0.0",
"@nestjs/core": "^7.0.0", "@nestjs/core": "^8.0.0",
"@nestjs/platform-express": "^7.0.0", "@nestjs/platform-express": "^8.0.0",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rxjs": "^6.5.4" "rxjs": "^7.2.0"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/cli": "^7.0.0", "@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^7.0.0", "@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^7.0.0", "@nestjs/testing": "^8.0.0",
"@types/express": "^4.17.3", "@types/express": "^4.17.13",
"@types/jest": "26.0.10", "@types/jest": "27.4.1",
"@types/node": "^13.9.1", "@types/node": "^16.0.0",
"@types/supertest": "^2.0.8", "@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "3.9.1", "@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "3.9.1", "@typescript-eslint/parser": "^5.0.0",
"eslint": "7.7.0", "eslint": "^8.0.1",
"eslint-config-prettier": "^6.10.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.20.1", "eslint-plugin-prettier": "^4.0.0",
"jest": "26.4.2", "jest": "^27.2.5",
"prettier": "^1.19.1", "prettier": "^2.3.2",
"supertest": "^4.0.2", "source-map-support": "^0.5.20",
"ts-jest": "26.2.0", "supertest": "^6.1.3",
"ts-loader": "^6.2.1", "ts-jest": "^27.0.3",
"ts-node": "9.0.0", "ts-loader": "^9.2.3",
"tsconfig-paths": "^3.9.0", "ts-node": "^10.0.0",
"typescript": "^3.7.4" "tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5"
}, },
"jest": { "jest": {
"moduleFileExtensions": [ "moduleFileExtensions": [
...@@ -57,10 +58,13 @@ ...@@ -57,10 +58,13 @@
"ts" "ts"
], ],
"rootDir": "src", "rootDir": "src",
"testRegex": ".spec.ts$", "testRegex": ".*\\.spec\\.ts$",
"transform": { "transform": {
"^.+\\.(t|j)s$": "ts-jest" "^.+\\.(t|j)s$": "ts-jest"
}, },
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage", "coverageDirectory": "../coverage",
"testEnvironment": "node" "testEnvironment": "node"
} }
......
{
"results": [{
"formatted_address": "10 rue saint Joseph",
"geometry": {
"location": {
"lat": 49.41229,
"lng": 2.82145
}
},
"id": "1113d3dd7339f965caae39387dd808a9e877bc2e",
"name": "l'Agence",
"loue": {
"loue": false,
"place_restant": 5
},
"place_id": "ChIJj62e80jHwoARusJT4mjohWw",
"price_level": 2,
"rating": 4.6,
"types": [
"colocation",
"etudiant"
]
},
{
"formatted_address": "6 rue saint Joseph",
"geometry": {
"location": {
"lat": 49.41137,
"lng": 2.8206
}
},
"id": "1113d5556dd7339f965caae39387dd808a9e877bc2e",
"name": "chambre solo",
"loue": {
"loue": true,
"place_restant": 1
},
"place_id": "ChIJj62e80jHwoARusJT4mjohWw",
"price_level": 2,
"rating": 2.6,
"types": [
"chambre",
"etudiant"
]
}
],
"status": "OK"
}
import { Controller, Get } from '@nestjs/common'; import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service'; import { AppService } from './app.service';
import { join } from 'path';
const places = require(join(__dirname, '..', 'resources/places.json'));
@Controller() @Controller()
export class AppController { export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) {}
@Get() @Get("allplaces")
getHello(): string { allplaces(): any {
return this.appService.getHello(); return places;
}
@Get("placedata")
placedata(): any {
return {
"formatted_address": "10 rue saint Joseph",
"geometry": {
"location": {
"lat": 49.41229,
"lng": 2.82145
}
},
"id": "1113d3dd7339f965caae39387dd808a9e877bc2e",
"name": "l'Agence",
"loue": {
"loue": false,
"place_restant": 5
},
"place_id": "ChIJj62e80jHwoARusJT4mjohWw",
"price_level": 2,
"rating": 4.6,
"types": [
"colocation",
"etudiant"
]
};
} }
} }
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
"sourceMap": true, "sourceMap": true,
"outDir": "./dist", "outDir": "./dist",
"baseUrl": "./", "baseUrl": "./",
"incremental": true "incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment