Skip to content

Commit

Permalink
Merge pull request #32 from jermbo/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jermbo authored Aug 17, 2018
2 parents d1a8cd7 + ca947c0 commit 9694783
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
Binary file added public/assets/images/poster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/poster.psd
Binary file not shown.
23 changes: 20 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sample APIs</title>
<link rel="stylesheet" href="assets/styles/home-styles.css">

<!--FACEBOOK-->
<meta property="og:title" content="Sample APIs">
<meta property="og:site_name" content="Sample APIs">
<meta property="og:url" content="https://sampleapis.com">
<meta property="og:description" content="A playground for RESTful endpoints.">
<meta property="og:image" content="https://sampleapis.com/assets/images/poster.jpg">
<meta property="og:type" content="website">
<!--TWITTER-->
<meta property="twitter:card" content="A playground for RESTful endpoints.">
<meta property="twitter:title" content="Sample APIs">
<meta property="twitter:description" content="A playground for RESTful endpoints.">
<meta property="twitter:creator" content="Jermbo">
<meta property="twitter:url" content="https://sampleapis.com">
<meta property="twitter:image" content="https://sampleapis.com/assets/images/poster.jpg">
<meta property="twitter:image:alt" content="Sample APIs">
</head>

<body>
Expand All @@ -15,9 +31,10 @@
<div class="site__inner">
<h1 class="site__title">Sample APIs</h1>
<p>Welcome to SampleAPIs. A playground for messing with RESTful endpoints. Checkout the project on
<a href="https://github.com/jermbo/SampleAPIs">GitHub</a> and consider contributing to the project with a new endpoint!</p>
<p>You can use any HTTP verbs (GET, POST, PUT, PATCH and DELETE) and access your resources from anywhere using
CORS and JSONP.</p>
<a href="https://github.com/jermbo/SampleAPIs">GitHub</a> and consider contributing to the project with
a new endpoint!</p>
<p>You can use any HTTP verbs (GET, POST, PUT, PATCH and DELETE) and access your resources from anywhere
using CORS and JSONP.</p>

<p class="disclaimer">The data on this site is for educational purposes only and is not owned by SampleAPIs.com</p>
<p class="disclaimer">The data on this site will be reset on a regular basis.</p>
Expand Down
15 changes: 15 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ const middleware = jsonServer.defaults();
const port = process.env.PORT || 5000;
const pages = ["futurama", "avatar", "baseball", "recipes", "fakebank"];

server.get("/reset", (req, res) => {
pages.forEach(page => {
fs.copyFile(
`./${page}/${page}.json.backup`,
`./${page}/${page}.json`,
err => {
if (err) {
console.error(err);
}
}
);
});
res.end("ok");
});

server.use(middleware);

pages.forEach(page => {
Expand Down

0 comments on commit 9694783

Please sign in to comment.