@@ -352,79 +352,6 @@ if (application.commandLineArguments.values.type === "backgroundJob")
352352 ) ;
353353 } ) ;
354354
355- if ( application . commandLineArguments . values . type === undefined ) {
356- for ( const port of application . privateConfiguration . ports ) {
357- node . childProcessKeepAlive ( ( ) =>
358- childProcess . spawn (
359- process . argv [ 0 ] ,
360- [
361- "--enable-source-maps" ,
362- process . argv [ 1 ] ,
363- ...application . commandLineArguments . positionals ,
364- "--type" ,
365- "server" ,
366- "--port" ,
367- String ( port ) ,
368- ] ,
369- {
370- env : {
371- ...process . env ,
372- NODE_ENV : application . configuration . environment ,
373- } ,
374- stdio : "inherit" ,
375- } ,
376- ) ,
377- ) ;
378- node . childProcessKeepAlive ( ( ) =>
379- childProcess . spawn (
380- process . argv [ 0 ] ,
381- [
382- "--enable-source-maps" ,
383- process . argv [ 1 ] ,
384- ...application . commandLineArguments . positionals ,
385- "--type" ,
386- "backgroundJob" ,
387- "--port" ,
388- String ( port ) ,
389- ] ,
390- {
391- env : {
392- ...process . env ,
393- NODE_ENV : application . configuration . environment ,
394- } ,
395- stdio : "inherit" ,
396- } ,
397- ) ,
398- ) ;
399- }
400- node . childProcessKeepAlive ( ( ) =>
401- childProcess . spawn (
402- process . argv [ 0 ] ,
403- [
404- "--enable-source-maps" ,
405- process . argv [ 1 ] ,
406- ...application . commandLineArguments . positionals ,
407- "--type" ,
408- "email" ,
409- ] ,
410- {
411- env : {
412- ...process . env ,
413- NODE_ENV : application . configuration . environment ,
414- } ,
415- stdio : "inherit" ,
416- } ,
417- ) ,
418- ) ;
419- caddy . start ( {
420- ...application . configuration ,
421- ...application . privateConfiguration ,
422- untrustedStaticFilesRoots : [
423- `/files/* "${ application . configuration . dataDirectory } "` ,
424- ] ,
425- } ) ;
426- }
427-
428355application . layout = ( { request, response, head, body } ) => {
429356 css `
430357 @import "@radically-straightforward/javascript/static/index.css";
@@ -1992,3 +1919,76 @@ if (application.commandLineArguments.values.type === "backgroundJob")
19921919 else if ( ! response . ok ) throw new Error ( `Response: ${ String ( response ) } ` ) ;
19931920 } ,
19941921 ) ;
1922+
1923+ if ( application . commandLineArguments . values . type === undefined ) {
1924+ for ( const port of application . privateConfiguration . ports ) {
1925+ node . childProcessKeepAlive ( ( ) =>
1926+ childProcess . spawn (
1927+ process . argv [ 0 ] ,
1928+ [
1929+ "--enable-source-maps" ,
1930+ process . argv [ 1 ] ,
1931+ ...application . commandLineArguments . positionals ,
1932+ "--type" ,
1933+ "server" ,
1934+ "--port" ,
1935+ String ( port ) ,
1936+ ] ,
1937+ {
1938+ env : {
1939+ ...process . env ,
1940+ NODE_ENV : application . configuration . environment ,
1941+ } ,
1942+ stdio : "inherit" ,
1943+ } ,
1944+ ) ,
1945+ ) ;
1946+ node . childProcessKeepAlive ( ( ) =>
1947+ childProcess . spawn (
1948+ process . argv [ 0 ] ,
1949+ [
1950+ "--enable-source-maps" ,
1951+ process . argv [ 1 ] ,
1952+ ...application . commandLineArguments . positionals ,
1953+ "--type" ,
1954+ "backgroundJob" ,
1955+ "--port" ,
1956+ String ( port ) ,
1957+ ] ,
1958+ {
1959+ env : {
1960+ ...process . env ,
1961+ NODE_ENV : application . configuration . environment ,
1962+ } ,
1963+ stdio : "inherit" ,
1964+ } ,
1965+ ) ,
1966+ ) ;
1967+ }
1968+ node . childProcessKeepAlive ( ( ) =>
1969+ childProcess . spawn (
1970+ process . argv [ 0 ] ,
1971+ [
1972+ "--enable-source-maps" ,
1973+ process . argv [ 1 ] ,
1974+ ...application . commandLineArguments . positionals ,
1975+ "--type" ,
1976+ "email" ,
1977+ ] ,
1978+ {
1979+ env : {
1980+ ...process . env ,
1981+ NODE_ENV : application . configuration . environment ,
1982+ } ,
1983+ stdio : "inherit" ,
1984+ } ,
1985+ ) ,
1986+ ) ;
1987+ caddy . start ( {
1988+ ...application . configuration ,
1989+ ...application . privateConfiguration ,
1990+ untrustedStaticFilesRoots : [
1991+ `/files/* "${ application . configuration . dataDirectory } "` ,
1992+ ] ,
1993+ } ) ;
1994+ }
0 commit comments