Skip to content

Commit

Permalink
Updates outdated packages, cleans up code, and adds basic integration…
Browse files Browse the repository at this point in the history
… testing
  • Loading branch information
drewthoennes committed Apr 14, 2020
1 parent ae40a7d commit 9309da6
Show file tree
Hide file tree
Showing 65 changed files with 5,115 additions and 5,547 deletions.
Binary file added .docs/website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Bored API
Find something better to do faster
A free and simple API to help you find something better to do

![Bored API Website](./.docs/website.png)

## About
This project is an MEVN (MongoDB, Express.js, Vue.js, and Node.js) app that has a goal of creating a simple way to find things to do.
This project is an MEVN (MongoDB, Express.js, Vue.js, and Node.js) web app that has a goal of creating a simple way to find things to do. You <u>do not need an API key</u> to use this API, just query the endpoint to get data. All activities served by the API can be found [here](./activities.json).

---
## Endpoints
The full documentation can be found [here](https://www.boredapi.com/documentation), but listed below are a few of the endpoints
The full documentation can be found [here](https://www.boredapi.com/documentation), but listed below are a few of the endpoints.

#### Random event
Gets a random event
Expand Down Expand Up @@ -42,19 +45,22 @@ Response:
}
```

---
## Using
To set up your own Bored API, clone the app and run:
To set up your own Bored API, clone the app, start your MongoDB instance, and run:
```bash
npm install
npm start
# Started on port 8080
```

---
## Contributing
All help is welcome! A pull request or a new issue would be very appreciated. If you want to add more activities, we've created a UI on the [website](https://www.boredapi.com/contributing) to make suggesting easy.
All help is welcome! A pull request or a new issue would be very appreciated. If you want to add more activities, I've created a UI on the [website](https://www.boredapi.com/contributing) to make suggesting easy.

---
## Usage
The Bored API has been used in a few other applications:
The Bored API has been used in many other applications and projects:

* [I'm Bored Alexa skill](https://www.amazon.com/gp/product/B07GDL9MP4?ie=UTF8&ref-suffix=ss_rw)
* [Python wrapper](https://pypi.org/project/bored/)
Expand Down
112 changes: 56 additions & 56 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@ const { VueLoaderPlugin } = require('vue-loader');
const CopyWebpackPlugin = require('copy-webpack-plugin');

function resolve (dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir)
}

module.exports = {
entry: {
app: './src/frontend/main.js'
},
output: {
path: resolve('dist'),
filename: '[name].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src/frontend'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'@babel/preset-env'
],
cacheDirectory: true
}
}
},
{
test: /\.css$/,
use: [
'vue-style-loader',
{
loader: 'css-loader'
}
]
}
]
},
plugins: [
new VueLoaderPlugin(),
new CopyWebpackPlugin([
{
from: resolve('static'),
to: resolve('dist'),
ignore: ['.*']
}
])
]
entry: {
app: './src/frontend/main.js'
},
output: {
path: resolve('dist'),
filename: '[name].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src/frontend'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'@babel/preset-env'
],
cacheDirectory: true
}
}
},
{
test: /\.css$/,
use: [
'vue-style-loader',
{
loader: 'css-loader'
}
]
}
]
},
plugins: [
new VueLoaderPlugin(),
new CopyWebpackPlugin([
{
from: resolve('static'),
to: resolve('dist'),
ignore: ['.*']
}
])
]
}
27 changes: 13 additions & 14 deletions build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ const baseWebpackConfig = require('./webpack.base.conf');
const HtmlWebpackPlugin = require('html-webpack-plugin');

function resolve (dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir)
}

module.exports = merge(baseWebpackConfig, {
mode: 'development',
output: {
path: resolve('dist'),
filename: 'js/[name].[chunkhash].js',
chunkFilename: 'js/[id].[chunkhash].js'
},
plugins: [
new HtmlWebpackPlugin({
template: resolve('static/index.html'),
inject: true,
chunksSortMode: 'dependency'
}),
]
mode: 'development',
output: {
path: resolve('dist'),
filename: 'js/[name].[chunkhash].js',
chunkFilename: 'js/[id].[chunkhash].js'
},
plugins: [
new HtmlWebpackPlugin({
template: resolve('static/index.html'),
inject: true
}),
]
});
40 changes: 0 additions & 40 deletions build/webpack.hot.conf.js

This file was deleted.

39 changes: 19 additions & 20 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

function resolve (dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir)
}

module.exports = merge(baseWebpackConfig, {
mode: 'production',
output: {
path: resolve('dist'),
filename: 'js/[name].[chunkhash].js',
chunkFilename: 'js/[id].[chunkhash].js'
},
plugins: [
new HtmlWebpackPlugin({
template: resolve('static/index.html'),
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
},
chunksSortMode: 'dependency'
}),
/* new BundleAnalyzerPlugin() */
]
mode: 'production',
output: {
path: resolve('dist'),
filename: 'js/[name].[chunkhash].js',
chunkFilename: 'js/[id].[chunkhash].js'
},
plugins: [
new HtmlWebpackPlugin({
template: resolve('static/index.html'),
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
}
}),
/* new BundleAnalyzerPlugin() */
]
});
14 changes: 7 additions & 7 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
dev: {
host: 'localhost',
port: 8080,
database: 'mongodb://localhost:27017/boredapi',
},
build: {
}
dev: {
host: 'localhost',
port: 8080,
database: 'mongodb://localhost:27017/boredapi',
},
build: {
}
}
15 changes: 1 addition & 14 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<title>Bored API</title>
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="js/app.10fd32b5f854a311a4ac.js"></script></body>
</html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css integrity=sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M crossorigin=anonymous><script src=https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js></script><script src=https://code.jquery.com/ui/1.12.1/jquery-ui.js></script><title>Bored API</title></head><body><div id=app></div><script src=js/app.ca6b7e73a33750e5a082.js></script></body></html>
Loading

0 comments on commit 9309da6

Please sign in to comment.