https://github.com/chinsun9/findip-nodejs
https://github.com/chinsun9/findip-nodejs
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chinsun9/findip-nodejs
- Owner: chinsun9
- Created: 2020-10-26T08:02:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T08:03:02.000Z (over 4 years ago)
- Last Synced: 2025-01-30T08:43:08.916Z (5 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# findip-nodejs
- https://www.findip.kr/ 을 따라만들기
## express generator로 프로젝트 생성
```
express findip-nodejs --view=ejs
```## IPv4 방식으로 보기
```js bin/www
server.listen(port, '0.0.0.0');
``````js routes/index.js
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
console.log(ip);
res.render('index', { title: 'findip', ip: ip });
```- ip를 index view에 렌더링하여 보냄