@20syldev/api 3.3.5 → 3.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/app.js +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<a href="https://api.sylvain.pro"><img src="https://api.sylvain.pro/favicon.ico" alt="Logo" width="25%" height="auto"/></a>
|
|
3
3
|
|
|
4
4
|
# API Personnelle
|
|
5
|
-
[](https://github.com/20syldev/api/releases/latest)
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
---
|
|
@@ -46,7 +46,7 @@ Enfin, **exécutez** le script de build, qui installera les **dépendances** et
|
|
|
46
46
|
$ npm run build
|
|
47
47
|
```
|
|
48
48
|
```console
|
|
49
|
-
> @20syldev/api@3.3.
|
|
49
|
+
> @20syldev/api@3.3.7 build
|
|
50
50
|
> npm install && node app.js
|
|
51
51
|
|
|
52
52
|
[...]
|
package/app.js
CHANGED
|
@@ -354,7 +354,7 @@ app.get('/:version/algorithms', (req, res) => {
|
|
|
354
354
|
if (!['anagram', 'bubblesort', 'factorial', 'fibonacci', 'gcd', 'isprime', 'palindrome', 'primefactors', 'primelist', 'reverse'].includes(method)) {
|
|
355
355
|
return res.jsonResponse({
|
|
356
356
|
error: 'Please provide a valid algorithm (?method={algorithm})',
|
|
357
|
-
documentation: `https://docs.sylvain.pro/${version}/algorithms`
|
|
357
|
+
documentation: `https://docs.sylvain.pro/${version}/en/algorithms`
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
if (!value) return res.jsonResponse({ error: 'Please provide a valid value (&value={value})' });
|
|
@@ -848,7 +848,7 @@ app.get('/:version/website', async (req, res) => {
|
|
|
848
848
|
if (currentTime - lastFetch >= 10 * 60 * 1000) {
|
|
849
849
|
try {
|
|
850
850
|
const username = '20syldev';
|
|
851
|
-
const token = process.env.
|
|
851
|
+
const token = process.env.GITHUB_TOKEN;
|
|
852
852
|
const today = new Date().toISOString().split('T')[0];
|
|
853
853
|
const monthFirst = new Date(new Date().getFullYear(), new Date().getMonth(), 1).toISOString().split('T')[0];
|
|
854
854
|
const lastYear = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split('T')[0];
|
|
@@ -930,10 +930,11 @@ app.get('/:version/website', async (req, res) => {
|
|
|
930
930
|
new_projects: process.env.NEW?.split(' ') || [],
|
|
931
931
|
sub_domains: process.env.DOMAINS?.split(' ') || [],
|
|
932
932
|
stats: {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
933
|
+
1: process.env.STATS1,
|
|
934
|
+
2: process.env.STATS2,
|
|
935
|
+
3: process.env.STATS3,
|
|
936
|
+
4: process.env.STATS4,
|
|
937
|
+
5: Object.keys(ipLimits).length,
|
|
937
938
|
today: contributions.today.toString(),
|
|
938
939
|
this_month: contributions.month.toString(),
|
|
939
940
|
last_year: contributions.year.toString(),
|
|
@@ -1010,8 +1011,8 @@ app.post('/:version/hash', (req, res) => {
|
|
|
1010
1011
|
|
|
1011
1012
|
if (!text) return res.jsonResponse({ error: 'Please provide a text (?text={text})' });
|
|
1012
1013
|
if (!method) return res.jsonResponse({
|
|
1013
|
-
error: 'Please provide a valid hash algorithm (
|
|
1014
|
-
documentation: `https://docs.sylvain.pro/${version}/hash`
|
|
1014
|
+
error: 'Please provide a valid hash algorithm (&method={algorithm})',
|
|
1015
|
+
documentation: `https://docs.sylvain.pro/${version}/en/hash`
|
|
1015
1016
|
});
|
|
1016
1017
|
|
|
1017
1018
|
const methods = getHashes();
|
package/package.json
CHANGED