-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vercel deployment with serverless functions (#5)
- Loading branch information
1 parent
8b30f54
commit ceec192
Showing
10 changed files
with
169 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,4 +113,5 @@ dist | |
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
.pnp.* | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.