UNPKG

@analogjs/router

Version:

Filesystem-based routing for Angular

1 lines 1.86 kB
{"version":3,"file":"analogjs-router-tokens.mjs","sources":["../../../../packages/router/tokens/src/index.ts","../../../../packages/router/tokens/src/analogjs-router-tokens.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport type {\n IncomingMessage,\n ServerResponse as NodeServerResponse,\n} from 'node:http';\n\nexport type ServerRequest = IncomingMessage & { originalUrl: string };\nexport type ServerResponse = NodeServerResponse;\nexport type ServerContext = { req: ServerRequest; res: ServerResponse };\n\nexport const REQUEST = new InjectionToken<ServerRequest>(\n '@analogjs/router Server Request',\n);\nexport const RESPONSE = new InjectionToken<ServerResponse>(\n '@analogjs/router Server Response',\n);\nexport const BASE_URL = new InjectionToken<string>('@analogjs/router Base URL');\n\nexport const API_PREFIX = new InjectionToken<string>(\n '@analogjs/router API Prefix',\n);\n\nexport function injectRequest() {\n return inject(REQUEST, { optional: true });\n}\n\nexport function injectResponse() {\n return inject(RESPONSE, { optional: true });\n}\n\nexport function injectBaseURL() {\n return inject(BASE_URL, { optional: true });\n}\n\nexport function injectAPIPrefix() {\n return inject(API_PREFIX);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAUa,OAAO,GAAG,IAAI,cAAc,CACvC,iCAAiC;MAEtB,QAAQ,GAAG,IAAI,cAAc,CACxC,kCAAkC;MAEvB,QAAQ,GAAG,IAAI,cAAc,CAAS,2BAA2B;MAEjE,UAAU,GAAG,IAAI,cAAc,CAC1C,6BAA6B;SAGf,aAAa,GAAA;IAC3B,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5C;SAEgB,cAAc,GAAA;IAC5B,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7C;SAEgB,aAAa,GAAA;IAC3B,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC7C;SAEgB,eAAe,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;ACpCA;;AAEG;;;;"}