Skip to content

Commit

Permalink
pushed test and API together
Browse files Browse the repository at this point in the history
  • Loading branch information
kunjgit committed Oct 15, 2023
1 parent 4b3c0eb commit 528a5ca
Show file tree
Hide file tree
Showing 29 changed files with 22,409 additions and 0 deletions.
16 changes: 16 additions & 0 deletions New_APIs/JsonServer_API/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
43 changes: 43 additions & 0 deletions New_APIs/JsonServer_API/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
.vscode
105 changes: 105 additions & 0 deletions New_APIs/JsonServer_API/API/dataset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"Person": [
{
"firstName": "Alice",
"lastName": "Smith",
"hobbies": ["reading", "painting", "gardening"],
"age": 28,
"children": [
{ "firstName": "Sophia", "age": 5 },
{ "firstName": "Oliver", "age": 7 }
]
},
{
"firstName": "John",
"lastName": "Johnson",
"hobbies": ["cooking", "photography", "hiking"],
"age": 42,
"children": [
{ "firstName": "Ella", "age": 9 },
{ "firstName": "Henry", "age": 6 }
]
},
{
"firstName": "Emily",
"lastName": "Davis",
"hobbies": ["swimming", "painting", "dancing"],
"age": 35,
"children": [
{ "firstName": "Ava", "age": 4 },
{ "firstName": "Liam", "age": 8 }
]
},
{
"firstName": "William",
"lastName": "Miller",
"hobbies": ["reading", "singing", "traveling"],
"age": 29,
"children": [
{ "firstName": "Mia", "age": 6 },
{ "firstName": "Noah", "age": 7 }
]
},
{
"firstName": "Sophia",
"lastName": "Wilson",
"hobbies": ["playing guitar", "drawing", "swimming"],
"age": 27,
"children": [
{ "firstName": "Luna", "age": 3 },
{ "firstName": "Ethan", "age": 5 }
]
},
{
"firstName": "Olivia",
"lastName": "Brown",
"hobbies": ["cooking", "watching movies", "yoga"],
"age": 38,
"children": [
{ "firstName": "Lucas", "age": 6 },
{ "firstName": "Aria", "age": 9 }
]
},
{
"firstName": "James",
"lastName": "Anderson",
"hobbies": ["gardening", "reading", "singing"],
"age": 33,
"children": [
{ "firstName": "Aiden", "age": 4 },
{ "firstName": "Harper", "age": 8 }
]
},
{
"firstName": "Ava",
"lastName": "Martinez",
"hobbies": ["dancing", "painting", "cooking"],
"age": 31,
"children": [
{ "firstName": "Zoe", "age": 7 },
{ "firstName": "Carter", "age": 5 }
]
},
{
"firstName": "Liam",
"lastName": "Garcia",
"hobbies": ["swimming", "watching movies", "traveling"],
"age": 29,
"children": [
{ "firstName": "Aria", "age": 6 },
{ "firstName": "Elijah", "age": 4 }
]
},
{
"firstName": "Mia",
"lastName": "Lee",
"hobbies": ["playing guitar", "yoga", "reading"],
"age": 34,
"children": [
{ "firstName": "Aiden", "age": 7 },
{ "firstName": "Scarlett", "age": 5 }
]
}

]
}
22 changes: 22 additions & 0 deletions New_APIs/JsonServer_API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Steps to run this template in your system

- clone the repo by ` git clone https://github.com/kunjgit/Anglar_API.git `
- install dependencies `npm i`
- setup API by the steps give below
- if you don't have angular cli just use command `npm install -g @angular/cli`
- go inside the repo where your code is there for API and just run it on server
- now open another tab of terminal and run this template by using `ng serve`


## Run your Json-server API

Take your json file to anywhere you want then install json-server globally from npm

`npm install -g json-server`

Run API on local

`json-server --watch <filename>`



101 changes: 101 additions & 0 deletions New_APIs/JsonServer_API/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"project": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/project",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "project:build:production"
},
"development": {
"browserTarget": "project:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "project:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": "b1daef7a-0741-4900-bca5-7a5b6f6092a2"
}
}
Loading

0 comments on commit 528a5ca

Please sign in to comment.