diff --git a/frontend/package.json b/frontend/package.json index a6801c5..fdc61cc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,8 +6,7 @@ "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", - "test": "ng test", - "serve:ssr:frontend": "node dist/frontend/server/server.mjs" + "test": "ng test" }, "private": true, "dependencies": { @@ -17,10 +16,7 @@ "@angular/forms": "^19.2.0", "@angular/platform-browser": "^19.2.0", "@angular/platform-browser-dynamic": "^19.2.0", - "@angular/platform-server": "^19.2.0", "@angular/router": "^19.2.0", - "@angular/ssr": "^19.2.5", - "express": "^4.18.2", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" @@ -29,9 +25,7 @@ "@angular-devkit/build-angular": "^19.2.5", "@angular/cli": "^19.2.5", "@angular/compiler-cli": "^19.2.0", - "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", - "@types/node": "^18.18.0", "jasmine-core": "~5.6.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", @@ -40,4 +34,4 @@ "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.7.2" } -} \ No newline at end of file +} diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html index 36093e1..fd6ee09 100644 --- a/frontend/src/app/app.component.html +++ b/frontend/src/app/app.component.html @@ -1,336 +1,6 @@ - - - - - - - - - - - -
-
-
- -

Hello, {{ title }}

-

Congratulations! Your app is running. 🎉

-
- -
-
- @for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; track item.title) { - - {{ item.title }} - - - - - } -
- -
-
+
+

Hello world

- - - - - - - - diff --git a/frontend/src/app/app.config.server.ts b/frontend/src/app/app.config.server.ts deleted file mode 100644 index 0125189..0000000 --- a/frontend/src/app/app.config.server.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; -import { provideServerRendering } from '@angular/platform-server'; -import { provideServerRouting } from '@angular/ssr'; -import { appConfig } from './app.config'; -import { serverRoutes } from './app.routes.server'; - -const serverConfig: ApplicationConfig = { - providers: [ - provideServerRendering(), - provideServerRouting(serverRoutes) - ] -}; - -export const config = mergeApplicationConfig(appConfig, serverConfig); diff --git a/frontend/src/app/app.config.ts b/frontend/src/app/app.config.ts index a9af518..a1e7d6f 100644 --- a/frontend/src/app/app.config.ts +++ b/frontend/src/app/app.config.ts @@ -2,8 +2,7 @@ import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; -import { provideClientHydration, withEventReplay } from '@angular/platform-browser'; export const appConfig: ApplicationConfig = { - providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay())] + providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] }; diff --git a/frontend/src/app/app.routes.server.ts b/frontend/src/app/app.routes.server.ts deleted file mode 100644 index ffd37b1..0000000 --- a/frontend/src/app/app.routes.server.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { RenderMode, ServerRoute } from '@angular/ssr'; - -export const serverRoutes: ServerRoute[] = [ - { - path: '**', - renderMode: RenderMode.Prerender - } -]; diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index 0d82da5..dc39edb 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -1,4 +1,3 @@ import { Routes } from '@angular/router'; -import {AppComponent} from './app.component'; -export const routes: Routes = [new AppComponent]; +export const routes: Routes = []; diff --git a/frontend/src/index.html b/frontend/src/index.html index 3af61ec..6f58962 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -5,7 +5,7 @@ Frontend - + diff --git a/frontend/src/main.server.ts b/frontend/src/main.server.ts deleted file mode 100644 index 4b9d4d1..0000000 --- a/frontend/src/main.server.ts +++ /dev/null @@ -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; diff --git a/frontend/src/server.ts b/frontend/src/server.ts deleted file mode 100644 index 591b7a6..0000000 --- a/frontend/src/server.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { - AngularNodeAppEngine, - createNodeRequestHandler, - isMainModule, - writeResponseToNodeResponse, -} from '@angular/ssr/node'; -import express from 'express'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const serverDistFolder = dirname(fileURLToPath(import.meta.url)); -const browserDistFolder = resolve(serverDistFolder, '../browser'); - -const app = express(); -const angularApp = new AngularNodeAppEngine(); - -/** - * Example Express Rest API endpoints can be defined here. - * Uncomment and define endpoints as necessary. - * - * Example: - * ```ts - * app.get('/api/**', (req, res) => { - * // Handle API request - * }); - * ``` - */ - -/** - * Serve static files from /browser - */ -app.use( - express.static(browserDistFolder, { - maxAge: '1y', - index: false, - redirect: false, - }), -); - -/** - * Handle all other requests by rendering the Angular application. - */ -app.use('/**', (req, res, next) => { - angularApp - .handle(req) - .then((response) => - response ? writeResponseToNodeResponse(response, res) : next(), - ) - .catch(next); -}); - -/** - * Start the server if this module is the main entry point. - * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. - */ -if (isMainModule(import.meta.url)) { - const port = process.env['PORT'] || 4000; - app.listen(port, () => { - console.log(`Node Express server listening on http://localhost:${port}`); - }); -} - -/** - * Request handler used by the Angular CLI (for dev-server and during build) or Firebase Cloud Functions. - */ -export const reqHandler = createNodeRequestHandler(app); diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json index 9ab8527..3775b37 100644 --- a/frontend/tsconfig.app.json +++ b/frontend/tsconfig.app.json @@ -4,14 +4,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [ - "node" - ] + "types": [] }, "files": [ - "src/main.ts", - "src/main.server.ts", - "src/server.ts" + "src/main.ts" ], "include": [ "src/**/*.d.ts"