Skip to content

Commit 93872e7

Browse files
Initial Commit
0 parents  commit 93872e7

File tree

6 files changed

+309
-0
lines changed

6 files changed

+309
-0
lines changed

.gitignore

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/node
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=node
4+
5+
### Node ###
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional stylelint cache
62+
.stylelintcache
63+
64+
# Microbundle cache
65+
.rpt2_cache/
66+
.rts2_cache_cjs/
67+
.rts2_cache_es/
68+
.rts2_cache_umd/
69+
70+
# Optional REPL history
71+
.node_repl_history
72+
73+
# Output of 'npm pack'
74+
*.tgz
75+
76+
# Yarn Integrity file
77+
.yarn-integrity
78+
79+
# dotenv environment variables file
80+
.env
81+
.env.test
82+
.env*.local
83+
84+
# parcel-bundler cache (https://parceljs.org/)
85+
.cache
86+
.parcel-cache
87+
88+
# Next.js build output
89+
.next
90+
91+
# Nuxt.js build / generate output
92+
.nuxt
93+
dist
94+
95+
# Storybook build outputs
96+
.out
97+
.storybook-out
98+
storybook-static
99+
100+
# rollup.js default build output
101+
dist/
102+
103+
# Gatsby files
104+
.cache/
105+
# Comment in the public line in if your project uses Gatsby and not Next.js
106+
# https://nextjs.org/blog/next-9-1#public-directory-support
107+
# public
108+
109+
# vuepress build output
110+
.vuepress/dist
111+
112+
# Serverless directories
113+
.serverless/
114+
115+
# FuseBox cache
116+
.fusebox/
117+
118+
# DynamoDB Local files
119+
.dynamodb/
120+
121+
# TernJS port file
122+
.tern-port
123+
124+
# Stores VSCode versions used for testing VSCode extensions
125+
.vscode-test
126+
127+
# Temporary folders
128+
tmp/
129+
temp/
130+
131+
# End of https://www.toptal.com/developers/gitignore/api/node

LICENSE.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2021 Danilo Del Busso
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
[![Contributors][contributors-shield]][contributors-url]
2+
[![Forks][forks-shield]][forks-url]
3+
[![Stargazers][stars-shield]][stars-url]
4+
[![Issues][issues-shield]][issues-url]
5+
[![MIT License][license-shield]][license-url]
6+
[![LinkedIn][linkedin-shield]][linkedin-url]
7+
8+
<!-- PROJECT LOGO -->
9+
<br />
10+
<p align="center">
11+
<a href="https://github.com/6CCS3PRJ/caching-function">
12+
<img src="docs/icon.png" alt="Logo" width="80" height="80">
13+
</a>
14+
15+
<h3 align="center">Caching Fu</h3>
16+
17+
<p align="center">
18+
Serverless function for AWS that calls a endpoint in <a href="https://github.com/6CCS3PRJ/server">server</a>. Developed as part of <a href="https://github.com/danilo-delbusso"><b>@danilo-delbusso</b></a>'s a final year project
19+
<br />
20+
<a href="https://github.com/6CCS3PRJ/caching-function/issues">Report Bug</a>
21+
</p>
22+
</p>
23+
24+
25+
<!-- TABLE OF CONTENTS -->
26+
<details open="open">
27+
<summary><h2 style="display: inline-block">Table of Contents</h2></summary>
28+
<ol>
29+
<li>
30+
<a href="#about-the-project">About The Project</a>
31+
</li>
32+
<li>
33+
<a href="#getting-started">Getting Started</a>
34+
<ul>
35+
<li><a href="#prerequisites">Prerequisites</a></li>
36+
<li><a href="#installation">Installation</a></li>
37+
</ul>
38+
</li>
39+
<li><a href="#roadmap">Roadmap</a></li>
40+
<li><a href="#contributing">Contributing</a></li>
41+
<li><a href="#license">License</a></li>
42+
<li><a href="#contact">Contact</a></li>
43+
</ol>
44+
</details>
45+
46+
47+
## About The Project
48+
49+
The project contains a simple AWS lambda function that invokes an endpoint to start the caching process for feature statistics calculation.
50+
51+
It does not implement authentication, since the REST API does not contain any.
52+
53+
54+
<!-- GETTING STARTED -->
55+
## Getting Started
56+
57+
To get a local copy up and running follow these simple steps.
58+
59+
### Prerequisites
60+
61+
Installation for this project are described for linux. For other operating systems, please refer to the links provided.
62+
63+
* [Node.js](https://nodejs.org/en/)
64+
* [npm](http://npmjs.com/)
65+
66+
It is suggested to install Node.js and npm using [nvm](https://github.com/nvm-sh/nvm#install--update-script).
67+
68+
### Installation
69+
70+
To install, first clone the repository
71+
72+
```zsh
73+
git clone https://github.com/6CCS3PRJ/caching-function.git
74+
```
75+
76+
There are no dependencies
77+
78+
The function is built to be invoked by AWS lambda. You can call it manually by calling the `startRequest` function in `index.js`.
79+
80+
<!-- ROADMAP -->
81+
## Roadmap
82+
83+
See the [open issues](https://github.com/6CCS3PRJ/caching-function/issues) for a list of proposed features (and known issues).
84+
85+
86+
<!-- CONTRIBUTING -->
87+
## Contributing
88+
89+
Contributions are what make the open source community such an amazing place to be learn, inspire, and create.
90+
91+
92+
The repo itself is just used to show the project. It is **NOT** actively maintained. The author suggests forking the project instead of opening new issues.
93+
94+
<!-- LICENSE -->
95+
## License
96+
97+
Distributed under the MIT License. See `LICENSE` for more information.
98+
99+
<!-- CONTACT -->
100+
## Contact
101+
102+
Danilo Del Busso - [@danilo_delbusso](https://twitter.com/danilo_delbusso)
103+
104+
105+
<!-- MARKDOWN LINKS & IMAGES -->
106+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
107+
[contributors-shield]: https://img.shields.io/github/contributors/6CCS3PRJ/caching-function.svg?style=for-the-badge
108+
[contributors-url]: https://github.com/6CCS3PRJ/caching-function/graphs/contributors
109+
[forks-shield]: https://img.shields.io/github/forks/6CCS3PRJ/caching-function.svg?style=for-the-badge
110+
[forks-url]: https://github.com/6CCS3PRJ/caching-function/network/members
111+
[stars-shield]: https://img.shields.io/github/stars/6CCS3PRJ/caching-function.svg?style=for-the-badge
112+
[stars-url]: https://github.com/6CCS3PRJ/caching-function/stargazers
113+
[issues-shield]: https://img.shields.io/github/issues/6CCS3PRJ/caching-function.svg?style=for-the-badge
114+
[issues-url]: https://github.com/6CCS3PRJ/caching-function/issues
115+
[license-shield]: https://img.shields.io/github/license/6CCS3PRJ/caching-function.svg?style=for-the-badge
116+
[license-url]: https://github.com/6CCS3PRJ/caching-function/blob/master/LICENSE.txt
117+
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
118+
[linkedin-url]: https://www.linkedin.com/in/danilo-delbusso/

docs/icon.png

18.2 KB
Loading

index.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const DEFAULT_API_ENDPOINT = "http://localhost:4683/api/v1/wifis/get/reloadFeatureCache"
2+
3+
const startRequest = async (event) => {
4+
fetch(process.env.API_ENDPOINT ?? DEFAULT_API_ENDPOINT);
5+
const response = {
6+
statusCode: 200,
7+
body: JSON.stringify('Request started.'),
8+
};
9+
return response;
10+
};
11+
12+
exports.handler = startRequest;

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "caching-function",
3+
"version": "0.0.1",
4+
"description": "Serverless function for AWS that calls a endpoint in server.",
5+
"main": "index.js",
6+
"directories": {
7+
"doc": "docs"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/6CCS3PRJ/caching-function.git"
15+
},
16+
"keywords": [
17+
"function",
18+
"aws",
19+
"caching",
20+
"serverless",
21+
"lambda"
22+
],
23+
"author": "Danilo Del Busso",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/6CCS3PRJ/caching-function/issues"
27+
},
28+
"homepage": "https://github.com/6CCS3PRJ/caching-function#readme"
29+
}

0 commit comments

Comments
 (0)