File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,9 +19,12 @@ A conscious choice was made to have the discord bot interact via the http endpoi
1919the http api and ensure it's capable. It also means that they can be hosted and restarted separately.
2020
2121## Running the projects in dev
22- Use ` ./gradlew bootRun ` to run the platform api and ` ./gradlew dev ` to run BotFest. Panel uses ` pnpm dev ` .
22+ Use ` ./gradlew bootRun ` to run the platform api and ` ./gradlew dev ` to run BotFest.
2323Platform api and panel will run without any configuration, whilst BotFest needs some setup (see [ here] ( ./botfest/about.md#dev-env ) ).
2424
25+ Panel can be started with ` pnpm dev ` . It tries to connect to the local backend by default but you can run it on the
26+ production backend using ` DEV_SERVER_URL="https://platform.modfest.net" pnpm dev `
27+
2528You can configure the port and address that the platform api will use in dev in the ` gradle.properties ` file. This
2629file is used in all subprojects.
2730
Original file line number Diff line number Diff line change 11import type { NextConfig } from "next" ;
22import { PHASE_DEVELOPMENT_SERVER } from "next/constants"
33import fs from 'node:fs/promises' ;
4+ import { env } from "node:process" ;
45
56const withBundleAnalyzer = require ( '@next/bundle-analyzer' ) ( {
67 enabled : process . env . ANALYZE === 'true' ,
78} )
89
910async function getDevUrl ( ) : Promise < string > {
11+ if ( env [ "DEV_SERVER_URL" ] ) {
12+ return env [ "DEV_SERVER_URL" ] ;
13+ }
14+
1015 const gradlePropsPath = __dirname + "/../gradle.properties"
1116 const gradleProps = await fs . readFile ( gradlePropsPath , { encoding : "utf-8" } )
1217 var lines = gradleProps . split ( "\n" )
@@ -20,17 +25,17 @@ async function getDevUrl(): Promise<string> {
2025}
2126
2227export default async function createConfig ( phase : string ) : Promise < NextConfig > {
23- var env = { }
28+ var env_vars = { }
2429 if ( phase === PHASE_DEVELOPMENT_SERVER ) {
25- env = {
30+ env_vars = {
2631 "DEV_SERVER_URL" : await getDevUrl ( ) ,
27- ...env
32+ ...env_vars
2833 }
2934 }
3035
3136 return withBundleAnalyzer ( {
3237 output : "standalone" ,
33- env : env ,
38+ env : env_vars ,
3439 // Enable source maps in prod
3540 productionBrowserSourceMaps : true ,
3641 // TODO these shouldn't really be ignored
You can’t perform that action at this time.
0 commit comments