Skip to content

Commit

Permalink
chore: github template (#187)
Browse files Browse the repository at this point in the history
* chore: remove vue-cli structure

* update README

* fix lint
  • Loading branch information
farnabaz authored Feb 3, 2021
1 parent 8fa47e8 commit 4c8a4df
Show file tree
Hide file tree
Showing 26 changed files with 36 additions and 68 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,36 @@

> [ExpressJS](http://expressjs.com/) + [Nuxt.js](https://nuxtjs.org) = :zap:
Live Demo: [https://codesandbox.io/s/github/nuxt-community/express-template/tree/demo](https://codesandbox.io/s/github/nuxt-community/express-template/tree/demo)
Live Demo: [https://codesandbox.io/s/github/nuxt-community/express-template](https://codesandbox.io/s/github/nuxt-community/express-template)

## Installation

This is a project template for [vue-cli](https://github.com/vuejs/vue-cli).
This is a template project, clone or fork the repo and start your project

```bash
vue init nuxt-community/express-template <project-name>
git clone https://github.com/nuxt-community/express-template.git <project-name>
cd <project-name> # move to your project
npm install # or yarn install
yarn install # or npm install
```

> Make sure to use a version of vue-cli >= 2.1 (vue -V).
## Build Setup

```bash
# install dependencies
$ yarn install

# serve with hot reload at localhost:3000
$ yarn dev

# build for production and launch server
$ yarn build
$ yarn start

# generate static project
$ yarn generate
```

For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).

## ExpressJS Changes

Expand Down Expand Up @@ -47,3 +64,5 @@ npm install # or yarn install
- [ExpressJS license](https://github.com/expressjs/express/blob/master/LICENSE)
- [NuxtJS license](https://github.com/nuxt/nuxt.js/blob/master/LICENSE.md)
- [VueJS license](https://github.com/vuejs/vue/blob/master/LICENSE)


1 change: 1 addition & 0 deletions template/api/index.js → api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = app
if (require.main === module) {
const port = process.env.PORT || 3001
app.listen(port, () => {
// eslint-disable-next-line no-console
console.log(`API server listening on port ${port}`)
})
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions template/components/Logo.vue → components/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{{{raw}}}}
<template>
<svg class="NuxtLogo" width="245" height="180" viewBox="0 0 452 342" xmlns="http://www.w3.org/2000/svg">
<path
Expand All @@ -15,7 +14,6 @@
/>
</svg>
</template>
{{{{/raw}}}}

<style>
.NuxtLogo {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions template/layouts/default.vue → layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{{{{raw}}}}
<template>
<div>
<Nuxt />
</div>
</template>
{{{{/raw}}}}

<style>
html {
Expand Down
12 changes: 8 additions & 4 deletions template/layouts/error.vue → layouts/error.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{{{raw}}}}
<template>
<section class="container">
<div>
Expand All @@ -9,16 +8,21 @@
<h2 class="info">
{{ error.message }}
</h2>
<nuxt-link class="button" to="/" v-if="error.statusCode === 404">
<nuxt-link v-if="error.statusCode === 404" class="button" to="/">
Homepage
</nuxt-link>
</div>
</section>
</template>
{{{{/raw}}}}

<script>
export default {
props: ['error']
props: {
error: {
type: Object,
default: () => ({})
}
}
}
</script>

Expand Down
25 changes: 0 additions & 25 deletions meta.js

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion template/nuxt.config.js → nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
'@nuxtjs/eslint-module'
],

/*
Expand Down
4 changes: 1 addition & 3 deletions template/package.json → package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "name",
"name": "nuxt-express",
"version": "1.0.0",
"description": "{{ description }}",
"author": "{{ author }}",
"private": true,
"scripts": {
"dev": "nuxt",
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions template/pages/index.vue → pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{{{raw}}}}
<template>
<div class="container">
<div>
Expand Down Expand Up @@ -38,7 +37,7 @@
</div>
</div>
</template>
{{{{/raw}}}}

<script>
export default {
async asyncData ({ $http }) {
Expand Down
2 changes: 0 additions & 2 deletions template/pages/users/_id.vue → pages/users/_id.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{{{raw}}}}
<template>
<section class="container">
<div>
Expand All @@ -15,7 +14,6 @@
</div>
</section>
</template>
{{{{/raw}}}}

<script>
export default {
Expand Down
2 changes: 0 additions & 2 deletions template/pages/users/index.vue → pages/users/index.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{{{raw}}}}
<template>
<section class="container">
<div>
Expand All @@ -19,7 +18,6 @@
</div>
</section>
</template>
{{{{/raw}}}}

<script>
export default {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions template/README.md

This file was deleted.

0 comments on commit 4c8a4df

Please sign in to comment.