Skip to content

Commit

Permalink
port was hardcoded with serve command and SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Apr 8, 2023
1 parent 5711324 commit 90faa02
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/serve.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getStaticServer, getHybridServer } from '../lifecycles/serve.js';
import { checkResourceExists } from '@greenwood/cli/src/lib/resource-utils.js';
import { checkResourceExists } from '../lib/resource-utils.js';

const runProdServer = async (compilation) => {

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lifecycles/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ async function getStaticServer(compilation, composable) {
}

async function getHybridServer(compilation) {
const { graph, manifest, context } = compilation;
const { graph, manifest, context, config } = compilation;
const { outputDir } = context;
const app = await getStaticServer(compilation, true);

app.use(async (ctx) => {
try {
const url = new URL(`http://localhost:8080${ctx.url}`);
const url = new URL(`http://localhost:${config.port}${ctx.url}`);
const matchingRoute = graph.find((node) => node.route === url.pathname) || { data: {} };
const isApiRoute = manifest.apis.has(url.pathname);
const request = new Request(url.href, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
interpolateFrontmatter: true
port: 8181
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
* greenwood build
*
* User Config
* None
* {
* port: 8181
* }
*
* User Workspace
* src/
Expand Down Expand Up @@ -40,7 +42,7 @@ describe('Serve Greenwood With: ', function() {
const LABEL = 'A Server Rendered Application (SSR)';
const cliPath = path.join(process.cwd(), 'packages/cli/src/index.js');
const outputPath = fileURLToPath(new URL('.', import.meta.url));
const hostname = 'http://127.0.0.1:8080';
const hostname = 'http://127.0.0.1:8181';
let runner;

before(async function() {
Expand Down

0 comments on commit 90faa02

Please sign in to comment.