import * as path from 'path';
import * as url from 'url';
const savePath = path.join('public', 'images', 'a.jpg');
// => \public\images\a.jpg
const urlPath = url.parse(savePath).path;
// => /public/images/a.jpg
相关文章
- Eclipse错误提示:The project was not built since its build path is incomplete. Cannot find the class file
- springMVC+mybatis 进行单元测试时 main SqlSessionFactoryBean - Parsed configuration file: 'class path resource' 无限的读取xml文件
- how can i get the source code path && file names from an ELF file(compired with -g)?
- 问题解决系列:cannot be resolved to absolute file path because it does not reside in the file system_ jar
- 让 nginx 支持thinkphp 的 PATH_INFO 和 URL Rewrite模式支持
- OCI runtime exec failed: exec failed: unable to start container process: exec: \"mongo\": executable file not found in $PATH: unknown
- Longest Absolute File Path
- 浅析python3中的os.path.dirname(__file__)的使用
- Eclipse------使用Debug As时报错java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/XXX
- Django web框架使用url path name详解