Skip to content

Commit

Permalink
Fix conflict using server.js
Browse files Browse the repository at this point in the history
Can't use `server.js`. So I chose `fastboot-server.js`.
See ember-fastboot/fastboot-app-server#30
  • Loading branch information
oskarrough committed Feb 18, 2017
1 parent 71be44e commit c725d61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -4,7 +4,7 @@ This example demonstrates deploying a server that uses [`ember-cli`](https://git

## How to deploy

First, [download `now`](https://zeit.co/download).
First, [download `now`](https://zeit.co/download).
Then, clone this repository and run `now`:

```bash
Expand All @@ -15,15 +15,15 @@ now
> Example: [`https://now-test-cqtighifnv.now.sh/`](https://now-test-cqtighifnv.now.sh/)
## How to setup deployment for your own ember-cli project

Add the `serve` package, which `now` will use to serve the static website. Bower will need to be installed locally as well, if you use it.

```bash
yarn add serve
yarn add bower
```

Update `engines` in `package.json` to at least node version 7.
Update `engines` in `package.json` to at least node version 7.
This is temporary. There is work being done to make `serve` work for older versions of node as well.

```json
Expand All @@ -32,7 +32,7 @@ This is temporary. There is work being done to make `serve` work for older versi
},
```

Add two new scripts to your `package.json`.
Add two new scripts to your `package.json`.

```json
"scripts": {
Expand All @@ -53,7 +53,7 @@ To get server-side rendering, we need to install two new packages:
yarn add ember-cli-fastboot fastboot-app-server
```

Put the following in a `server.js` file:
Put the following in a `fastboot-server.js` file:

```js
const FastBootAppServer = require('fastboot-app-server');
Expand All @@ -67,7 +67,7 @@ server.start();
Modify your `now-start` script in package.json to:

```json
"now-start": "PORT=8000 node server.js"
"now-start": "PORT=8000 node fastboot-server.js"
```

That's it. Now, when you run `now`, your Ember app will be served by a [fastboot-app-server](https://github.com/ember-fastboot/fastboot-app-server#quick-start) instead of `serve`.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"build": "ember build",
"start": "ember server",
"now-build": "bower install; ember build --environment=production",
"now-start": "PORT=8000 node server.js",
"now-start": "PORT=8000 node fastboot-server.js",
"test": "ember test"
},
"devDependencies": {
Expand Down

0 comments on commit c725d61

Please sign in to comment.