You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/deployment.md
+17-57Lines changed: 17 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -263,75 +263,35 @@ You can now access your project on `https://<YOUR-PROJECT-ID>.firebaseapp.com`.
263
263
264
264
Please refer to the [Firebase Documentation](https://firebase.google.com/docs/hosting/deploying) for more details.
265
265
266
-
### Now
266
+
### ZEITNow
267
267
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).
269
269
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 interfacewith [npm](https://www.npmjs.com/package/now), run the following command:
271
275
272
276
```bash
273
277
npm install -g now
274
278
```
275
279
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
321
281
322
-
3. Adding a deployment script in`package.json`:
282
+
You can deploy your application by running the following command inthe root of the project directory:
323
283
324
-
```json
325
-
"deploy": "npm run build && now --target production"
326
-
```
284
+
```bash
285
+
now
286
+
```
327
287
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).
329
289
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
333
293
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/).
0 commit comments