mirror of
https://github.com/zhigang1992/favicongrabber.com.git
synced 2026-01-12 09:03:58 +08:00
Added server endpoint
This commit is contained in:
2
.env.example
Normal file
2
.env.example
Normal file
@@ -0,0 +1,2 @@
|
||||
NODE_PORT=5000
|
||||
NODE_ENV=development
|
||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
.*/
|
||||
node_modules/
|
||||
|
||||
.env
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 antongunov
|
||||
Copyright (c) 2017 Anton Gunov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
# favicongrabber
|
||||
A simple tool to grab favicons
|
||||
# Favicon Grabber
|
||||
|
||||
A simple tool to grab favicons.
|
||||
|
||||
## License
|
||||
|
||||
The code is available under the [MIT License](LICENSE).
|
||||
|
||||
12
package-lock.json
generated
Normal file
12
package-lock.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "favicongrabber",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"dotenv": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz",
|
||||
"integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0="
|
||||
}
|
||||
}
|
||||
}
|
||||
15
package.json
Normal file
15
package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "favicongrabber",
|
||||
"version": "0.1.0",
|
||||
"description": "A simple tool to grab favicons",
|
||||
"repository": "https://github.com/antongunov/favicongrabber.git",
|
||||
"private": true,
|
||||
"author": "Anton Gunov <anton@gunov.name>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "node -r dotenv/config server/server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^4.0.0"
|
||||
}
|
||||
}
|
||||
15
server/server.js
Normal file
15
server/server.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Favicon Grabber
|
||||
*/
|
||||
|
||||
const http = require('http');
|
||||
|
||||
const NODE_PORT = parseInt(process.env.NODE_PORT, 10);
|
||||
|
||||
const srv = http.createServer((req, res) => {
|
||||
res.end('Hi!');
|
||||
});
|
||||
|
||||
srv.listen(NODE_PORT, () => {
|
||||
console.log(`Server listening on port ${NODE_PORT} in ${process.env.NODE_ENV} mode...`);
|
||||
});
|
||||
Reference in New Issue
Block a user