Polymer/prpl-server

Not able to serve PWA Starter from Express

ivanovivelin opened this issue · 1 comments

Hi,

I am unable to serve the index of PWA started using custom express server.

Getting the following logs :

Serving files from "/Users/ivanoviv/Desktop/client/server/server/build".
Registered entrypoint "esm-bundled/index.html" with capabilities [es2015,modules].
WARNING: Entrypoint "esm-bundled/index.html" does not exist.
Registered entrypoint "es6-bundled/index.html" with capabilities [es2015].
WARNING: Entrypoint "es6-bundled/index.html" does not exist.
Registered entrypoint "es5-bundled/index.html" with capabilities [].
WARNING: Entrypoint "es5-bundled/index.html" does not exist.
Serving files from "/Users/ivanoviv/Desktop/client/server/server/build".
Registered entrypoint "esm-bundled/index.html" with capabilities [es2015,modules].
WARNING: Entrypoint "esm-bundled/index.html" does not exist.
Registered entrypoint "es6-bundled/index.html" with capabilities [es2015].
WARNING: Entrypoint "es6-bundled/index.html" does not exist.
Registered entrypoint "es5-bundled/index.html" with capabilities [].
WARNING: Entrypoint "es5-bundled/index.html" does not exist.
Express Server Listening on port 3000

import express from 'express';
import path from 'path';
import cookieParser from 'cookie-parser';
import logger from 'morgan';
import indexRouter from './routes/index';
let prpl = require('prpl-server');
let polyConfigFile = require("../build/polymer.json");
const app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());

app.get('/api/launch', (req, res, next) => res.send('boom'));

app.get('/*', prpl.makeHandler(path.join(__dirname, '../server/build'), polyConfigFile));

export default app;

Resolved. Wrong paths on the server.