Skip to content

Commit 7e6de2a

Browse files
leoNataliaTepluhina
authored andcommitted
Adjusted deployment documentation for ZEIT Now (#4412)
1 parent 5dfea81 commit 7e6de2a

File tree

1 file changed

+17
-57
lines changed

1 file changed

+17
-57
lines changed

docs/guide/deployment.md

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -263,75 +263,35 @@ You can now access your project on `https://<YOUR-PROJECT-ID>.firebaseapp.com`.
263263

264264
Please refer to the [Firebase Documentation](https://firebase.google.com/docs/hosting/deploying) for more details.
265265

266-
### Now
266+
### ZEIT Now
267267

268-
This example uses the latest Now platform version 2.
268+
[ZEIT Now](https://zeit.co) is a cloud platform for websites and serverless APIs, that you can use to deploy your Vue projects to your personal domain (or a free `.now.sh` suffixed URL).
269269

270-
1. Install the Now CLI globally:
270+
This guide will show you how to get started in a few quick steps:
271+
272+
#### Step 1: Installing Now CLI
273+
274+
To install their command-line interface with [npm](https://www.npmjs.com/package/now), run the following command:
271275

272276
```bash
273277
npm install -g now
274278
```
275279

276-
2. Add a `now.json` file to your project root:
277-
278-
```json
279-
{
280-
"name": "my-example-app",
281-
"version": 2,
282-
"builds": [
283-
{ "src": "dist/**", "use": "@now/static" }
284-
],
285-
"routes": [
286-
{ "src": "/(.*)", "dest": "dist/$1" }
287-
],
288-
"alias": "vue-example"
289-
}
290-
```
291-
292-
In case you want to deploy an application with router mode set to history, the config file should look like the following (if you have different folder names, update your config accordingly):
293-
```json
294-
{
295-
"name": "my-example-app",
296-
"version": 2,
297-
"builds": [
298-
{
299-
"src": "dist/**",
300-
"use": "@now/static"
301-
}
302-
],
303-
"routes": [
304-
{
305-
"src": "/(js|css|img)/(.*)",
306-
"dest": "/dist/$1/$2"
307-
},
308-
{
309-
"src": "/favicon.ico",
310-
"dest": "/dist/favicon.ico"
311-
},
312-
{
313-
"src": "/(.*)",
314-
"dest": "/dist"
315-
}
316-
],
317-
"alias": "vue-example"
318-
}
319-
```
320-
This additional config is required in order to avoid issues when directly deep-linking to a specific page (e.g. when opening `my-example-app.now.sh/some-subpage`, you would be presented with a 404 error otherwise).
280+
#### Step 2: Deploying
321281

322-
3. Adding a deployment script in `package.json`:
282+
You can deploy your application by running the following command in the root of the project directory:
323283

324-
```json
325-
"deploy": "npm run build && now --target production"
326-
```
284+
```bash
285+
now
286+
```
327287

328-
If you want to deploy publicly by default, you can change the deployment script to the following one:
288+
**Alternatively**, you can also use their integration for [GitHub](https://zeit.co/github) or [GitLab](https://zeit.co/gitlab).
329289

330-
```json
331-
"deploy": "npm run build && now --target production --public"
332-
```
290+
That’s all!
291+
292+
Your site will deploy, and you will receive a link similar to the following: https://vue.now-examples.now.sh
333293

334-
This will automatically point your site's alias to the latest deployment. Now, just run `npm run deploy` to deploy your app.
294+
Out of the box, you are already provided with the necessary routes for rewriting requests (except for custom static files) directly to your `index.html` file and the appropiate default caching headers. This behaviour can be overwritten [like this](https://zeit.co/docs/v2/advanced/routes/).
335295

336296
### Stdlib
337297

0 commit comments

Comments
 (0)