Skip to content

Commit

Permalink
vercel deployment with serverless functions (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pramod-Devireddy authored Oct 2, 2020
1 parent 8b30f54 commit ceec192
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 410 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,5 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*
.vercel
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# ISRO API
# ISRO🚀 API

API for ISRO's Past Launch Details
Open Source API for Launched Spacecrafts & Rockets data of ISRO

## API End-Points

<ul>
<li> Spacecrafts: <a href="https://isro.vercel.app/api/spacecrafts" target="_blank" rel="noopener"
rel="noreferrer">isro.vercel.app/api/spacecrafts</a></li>
<li> Launchers: <a href="https://isro.vercel.app/api/launchers" target="_blank" rel="noopener"
rel="noreferrer">isro.vercel.app/api/launchers</a></li>
</ul>
25 changes: 25 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* File : index.js
* Project : ISRO-API
* Created Date : Thursday, Oct 1st 2020, 1:02:14 AM
* Author : Pramod Devireddy
*
* Last Modified: Friday, 2nd October 2020 12:50:11 pm
* Modified By : Pramod Devireddy
*
* Copyright (c)2020 - Pramod Devireddy
* ***************************************************************
*/

module.exports = async (req, res) => {
try {
res.send("<pre> ISRO API v0.0.1 </pre>");
} catch (error) {
res.status(500);
const response = error.response || {};
res.send({
message: error.message,
response,
});
}
};
29 changes: 29 additions & 0 deletions api/launchers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* File : launchers.js
* Project : ISRO API
* Created Date : Friday, Oct 2nd 2020, 12:03:24 PM
* Author : Pramod Devireddy
*
* Last Modified: Friday, 2nd October 2020 1:13:00 pm
* Modified By : Pramod Devireddy
*
* Copyright (c)2020 - Pramod Devireddy
* ***************************************************************
*/

const fs = require("fs");

var launchers = require("../data/launchers.json");

module.exports = async (req, res) => {
try {
res.send(launchers);
} catch (error) {
res.status(500);
const response = error.response || {};
res.send({
message: error.message,
response,
});
}
};
29 changes: 29 additions & 0 deletions api/spacecrafts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* File : spacecrafts.js
* Project : ISRO API
* Created Date : Friday, Oct 2nd 2020, 12:03:34 PM
* Author : Pramod Devireddy
*
* Last Modified: Friday, 2nd October 2020 1:14:18 pm
* Modified By : Pramod Devireddy
*
* Copyright (c)2020 - Pramod Devireddy
* ***************************************************************
*/

const fs = require("fs");

var launchers = require("../data/spacecrafts.json");

module.exports = async (req, res) => {
try {
res.send(launchers);
} catch (error) {
res.status(500);
const response = error.response || {};
res.send({
message: error.message,
response,
});
}
};
Empty file removed data/missions.json
Empty file.
70 changes: 70 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!--
File : index.html
Project : ISRO API
Created Date : Friday, Oct 2nd 2020, 1:30:07 PM
Author : Pramod Devireddy
Last Modified: Friday, 2nd October 2020 2:26:57 pm
Modified By : Pramod Devireddy
Copyright (c)2020 - Pramod Devireddy
***************************************************************
-->

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ISRO-API</title>

<style>
.container {
margin: auto 15%;
}

.content {
max-width: 650px;
color: #242424;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif
}

h1,
h2,
h3 {
font-weight: 600;
padding-bottom: .3em;
border-bottom: 1px solid #eaecef;
}

li {
padding-bottom: .5em;
}

a {
text-decoration: none;
color: rgb(67, 124, 230);
}
</style>
</head>

<body>
<div class="container">
<div class="content">
<h1>ISRO🚀 API</h1>
<p>Open Source API for Launched Spacecrafts & Rockets data of ISRO</p>
<h2>API End-Points</h2>
<ul>
<li> Spacecrafts: <a href="https://isro.vercel.app/api/spacecrafts" target="_blank" rel="noopener"
rel="noreferrer">isro.vercel.app/api/spacecrafts</a></li>
<li> Launchers: <a href="https://isro.vercel.app/api/launchers" target="_blank" rel="noopener"
rel="noreferrer">isro.vercel.app/api/launchers</a></li>
</ul>
<p>*Contribute at <a href="https://github.com/isro/api">GitHub</a> </p>
</div>
</div>

</body>

</html>
39 changes: 0 additions & 39 deletions index.js

This file was deleted.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"version": "0.0.1",
"description": "API for ISRO",
"main": "index.js",
"repository": "isroapis.web.app",
"repository": "isro.vercel.app",
"author": "Pramod Devireddy",
"license": "MIT",
"dependencies": {
"express": "^4.17.1"
}
"dependencies": {},
"devDependencies": {}
}
Loading

0 comments on commit ceec192

Please sign in to comment.