Recreate project
continuous-integration/drone/push Build is failing Details

stubModel
Corentin RICHARD 1 year ago
parent e4ee891600
commit 4886edf47c

@ -1,11 +0,0 @@
FROM node:alpine
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install -g @angular/cli
RUN npm install
CMD ["ng", "serve", "--host", "0.0.0.0"]

@ -1,6 +1,6 @@
# Daidokoro # Daidokoro
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0. This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.0.4.
## Development server ## Development server

@ -27,15 +27,9 @@
} }
], ],
"styles": [ "styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css" "src/styles.css"
], ],
"scripts": [], "scripts": []
"server": "src/main.server.ts",
"prerender": true,
"ssr": {
"entry": "server.ts"
}
}, },
"configurations": { "configurations": {
"production": { "production": {
@ -91,7 +85,6 @@
} }
], ],
"styles": [ "styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css" "src/styles.css"
], ],
"scripts": [] "scripts": []

File diff suppressed because it is too large Load Diff

@ -6,35 +6,27 @@
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test", "test": "ng test"
"serve:ssr:daidokoro": "node dist/daidokoro/server/server.mjs"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^18.0.0", "@angular/animations": "^18.0.0",
"@angular/cdk": "^17.3.10",
"@angular/common": "^18.0.0", "@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0", "@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0", "@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0", "@angular/forms": "^18.0.0",
"@angular/material": "^17.3.10",
"@angular/platform-browser": "^18.0.0", "@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0", "@angular/platform-browser-dynamic": "^18.0.0",
"@angular/platform-server": "^18.0.0",
"@angular/router": "^18.0.0", "@angular/router": "^18.0.0",
"@angular/ssr": "^18.0.3",
"express": "^4.18.2",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.14.3" "zone.js": "~0.14.3"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^18.0.3", "@angular-devkit/build-angular": "^18.0.4",
"@angular/cli": "^17.0.0", "@angular/cli": "^18.0.4",
"@angular/compiler-cli": "^18.0.0", "@angular/compiler-cli": "^18.0.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0", "@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
"jasmine-core": "~5.1.0", "jasmine-core": "~5.1.0",
"karma": "~6.4.0", "karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
@ -43,4 +35,4 @@
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.4.2" "typescript": "~5.4.2"
} }
} }

@ -1,57 +0,0 @@
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import express from 'express';
import { fileURLToPath } from 'node:url';
import { dirname, join, resolve } from 'node:path';
import bootstrap from './src/main.server';
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
const browserDistFolder = resolve(serverDistFolder, '../browser');
const indexHtml = join(serverDistFolder, 'index.server.html');
const commonEngine = new CommonEngine();
server.set('view engine', 'html');
server.set('views', browserDistFolder);
// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get('**', express.static(browserDistFolder, {
maxAge: '1y',
index: 'index.html',
}));
// All regular routes use the Angular engine
server.get('**', (req, res, next) => {
const { protocol, originalUrl, baseUrl, headers } = req;
commonEngine
.render({
bootstrap,
documentFilePath: indexHtml,
url: `${protocol}://${headers.host}${originalUrl}`,
publicPath: browserDistFolder,
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
})
.then((html) => res.send(html))
.catch((err) => next(err));
});
return server;
}
function run(): void {
const port = process.env['PORT'] || 4000;
// Start up the Node server
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}
run();

@ -1,11 +0,0 @@
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
import { provideServerRendering } from '@angular/platform-server';
import { appConfig } from './app.config';
const serverConfig: ApplicationConfig = {
providers: [
provideServerRendering()
]
};
export const config = mergeApplicationConfig(appConfig, serverConfig);

@ -2,9 +2,7 @@ import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router'; import { provideRouter } from '@angular/router';
import { routes } from './app.routes'; import { routes } from './app.routes';
import { provideClientHydration } from '@angular/platform-browser';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(), provideAnimationsAsync()] providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
}; };

@ -1,4 +0,0 @@
export interface Ingredient {
id:number
Name: string
}

@ -1,10 +0,0 @@
import { Ingredient } from "./ingredient.model"
export interface Recette {
id:number
name:string
description:string
imageBase64: string
ingredients: Ingredient[]
}

@ -6,10 +6,8 @@
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head> </head>
<body class="mat-typography"> <body>
<app-root></app-root> <app-root></app-root>
</body> </body>
</html> </html>

@ -1,7 +0,0 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { config } from './app/app.config.server';
const bootstrap = () => bootstrapApplication(AppComponent, config);
export default bootstrap;

@ -1,4 +1 @@
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }

@ -4,14 +4,10 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/app", "outDir": "./out-tsc/app",
"types": [ "types": []
"node"
]
}, },
"files": [ "files": [
"src/main.ts", "src/main.ts"
"src/main.server.ts",
"server.ts"
], ],
"include": [ "include": [
"src/**/*.d.ts" "src/**/*.d.ts"

Loading…
Cancel
Save