Skip to content

Commit ad445c2

Browse files
committed
deployed
1 parent cd04125 commit ad445c2

File tree

9 files changed

+41
-11
lines changed

9 files changed

+41
-11
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Simple Projects done by me while learning `Vue JS`.
2222

2323
---
2424

25+
#### Task 4 ( Simple MEVN Stack Application )
26+
27+
- This site is deployed to `Heroku` and see demo [here](https://mevn-noob-1.herokuapp.com/)
28+
2529
### Setup on Local Enviroment
2630

2731
```

vue-noob-4/.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ node_modules
22
.env
33
.DS_Store
44
node_modules
5-
/dist
5+
6+
# For Github Files only
7+
dist
8+
public
9+
# For Server Files only
10+
# client
611

712
# local env files
813
.env.local

vue-noob-4/client/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

vue-noob-4/client/src/components/pages/Home.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
<td>{{ customer.lastName }}</td>
3030
<td>{{ customer.email }}</td>
3131
<td>
32-
<router-link class="btn btn-secondary" :to="`/view/${customer._id}`">View</router-link>
32+
<router-link class="btn btn-sm btn-secondary" :to="`/view/${customer._id}`">View</router-link>
3333
</td>
3434
</tr>
3535
<tr v-else v-for="customer in customers" :key="customer._id">
3636
<td>{{ customer.firstName }}</td>
3737
<td>{{ customer.lastName }}</td>
3838
<td>{{ customer.email }}</td>
3939
<td>
40-
<router-link class="btn btn-secondary" :to="`/view/${customer._id}`">View</router-link>
40+
<router-link class="btn btn-sm btn-secondary" :to="`/view/${customer._id}`">View</router-link>
4141
</td>
4242
</tr>
4343
</tbody>

vue-noob-4/client/src/components/pages/View.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<div class="mt-3 d-flex align-items-center">
77
<h1 class="text-dark">{{ customer.firstName }} {{ customer.lastName }}</h1>
88
<div class="ml-auto">
9-
<router-link :to="`/edit/${$route.params.id}`" class="btn btn-info">Edit</router-link>
9+
<router-link :to="`/edit/${$route.params.id}`" class="btn btn-sm btn-info">Edit</router-link>
1010
<button
1111
@click="handleDelete"
12-
class="btn btn-danger ml-2"
12+
class="btn btn-sm btn-danger ml-2"
1313
>{{ dltBtnClicked ? 'Loading ...' : 'Delete' }}</button>
1414
</div>
1515
</div>

vue-noob-4/client/src/store.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ const sendRequest = async body => {
1212
body,
1313
redirect: 'follow',
1414
};
15-
let uri = ``;
16-
if (process.env.NODE_ENV !== 'production') {
17-
uri += 'http://localhost:5000';
18-
}
19-
const res = await fetch(`${uri}/api_v1_graphql`, requestOptions);
15+
const res = await fetch(`/api_v1_graphql`, requestOptions);
2016
const JSONData = await res.json();
2117
return JSONData;
2218
};

vue-noob-4/client/vue.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path');
2+
module.exports = {
3+
outputDir: path.resolve(__dirname, '../public'),
4+
devServer: {
5+
proxy: {
6+
'/api': {
7+
target: 'http://localhost:5000',
8+
},
9+
},
10+
},
11+
};

vue-noob-4/server.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ app.use(
2424
})
2525
);
2626

27+
if (process.env.NODE_ENV === 'production') {
28+
app.use(express.static(__dirname + '/public/'));
29+
app.get('*', async (req, res) => {
30+
res.sendFile(__dirname + '/public/index.html');
31+
});
32+
}
33+
2734
const PORT = process.env.PORT || 5000;
2835
app.listen(PORT, () => {
2936
console.log(`Server started on port ${PORT}`);
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
index.html,1595749628301,5226a91c0d587d02b7bbbffbc8d760d13b6590e62465433807861f852828fbef
1+
index.html,1595750017323,25381bc049ec413bb4eb56cf59a17d55934d4e4c3dc269a3108b96a5cb987500
2+
css/app.0f7e6187.css,1595750017317,3ceca3b8b205f6ababfb9268fc961776e91171d4fd17747e92f9f409d085a638
3+
favicon.ico,1595750017317,d5451f0f0f0bcbcd433bbdf4f6e7e5d89d8ecce2650649e969ccb5e5cd499ab2
4+
js/app.3d5bd6a5.js,1595750017323,d1229d7f6eddcdd23a836c82b0efd8c21902398fa6bce15d369c4e045d62b021
5+
js/app.3d5bd6a5.js.map,1595750017324,7bb9c357f9f7bcd0543b1979abe9af9d8b5eeaf9954eee1025cbd5d62bfd68d5
6+
js/chunk-vendors.ebfffe87.js,1595750017323,6c8ec3b0ba77073ba2de23e15816bd89863f986753d68dc73d2600cc67a110e8
7+
js/chunk-vendors.ebfffe87.js.map,1595750017324,f16a7214782c49f3563ece6aa13867869e8b6dae32c8a88defc27ba10147062d

0 commit comments

Comments
 (0)